Converting AVI’s to SVI’s for the Samsung YP-P2

3 minute read

* If you are using Ubuntu Jaunty please read all the way through the article as there are updates at the bottom.

* For Ubuntu 11.04 (Natty), please read/use my latest updates to the YP-P2 action.

I watch quite a few movies on my Samsung YP-P2, so am always having to covert the AVI's I currently have to SVI's. An SVI is still an AVI, just a different extension name and a few key points, which include not having any b-frames, the video being 480x272 in resolution, and a few other things.

Anyway...I'm an Ubuntu (not Windows!) user so I firstly started encoding my videos using Avidemux. Which is an excellent an easy to use GUI for converting videos into whatever format/specifics you need. However, it's still a pain to have to open it up, load a video, check all the settings etc...

Setup

Firstly, install mencoder

sudo apt-get install mencoder

Once installed, you can use the following script in a Terminal window to convert a file.

mencoder -noodml ${InputFile} -o ${OutputFile} -ofps 25 -vf-add crop=0:0:-1:-1 -vf-add scale=480:272 -vf-add expand=480:272:-1:-1:1 -srate 44100 -ovc xvid -xvidencopts bitrate=128 -oac mp3lame -lameopts vbr=0 -lameopts br=128 -lameopts vol=0 -lameopts mode=0 -lameopts aq=7 -lameopts padding=3 -af volnorm -xvidencopts max_bframes=0:nogmc:noqpel -mc 0

In the above you'll need to replace ${InputFile} with a file path (e.g. /media/Movies/Rambo.avi) and ${OutputFile} with the output path (e.g. /media/P2/Video/Rambo.svi). I've also highlighted "25" which is the framerate, and "128" which is the mp3 bitrate. I never bother changing those though.

Nautilus Integration

Now, this is still quite a pain to use, so next I implemented it into Nautilus Actions Configuration. If you haven't got this installed, install it by running the following in the Terminal window.

sudo apt-get install nautilus-actions

If you go to System > Preferences > Nautilus Actions Configuration, you'll be presented with a new Window. There should be an import/export button. Click that and import the file attached at the bottom of this article.

This will basically give you "right-click" functionality. If you right-click on any AVI file, there'll be a "Send to YP-P2" option. If you select that, it'll convert the file you clicked on, and copy it to the YP-P2. Now I can copy movies to my YP-P2 in two clicks.

UPDATE 26/11/2008

As Ryan mentioned in the comments, make sure you have the P2 mounted before doing the right click part.

Also when you do, you won't see anything visually happen. I.e. no progress bar etc... The only way to tell it's copying the file, is to browse to the P2 in Nautilus and see if a new file has been added (and Refresh to see it increase in size as it gets written to the P2).

I've not looked into sorting out some sort of progress bar, although I'd imagine it to be quite difficult with the way things are currently done. For now I just set a few AVI's converting, and then wait a while.

UPDATE 03/05/2009

Unfortunately, if you're using Ubuntu Jaunty this script won't work anymore. Nautilus Actions seems to be partially broken in Jaunty. It's something I noticed upon installing the beta. There are some posts about it, but apparently (I've not had time to look into it much yet) %M is not parsing or working properly (and is used in the schema attached to this post). I'll be looking into a fix, or possibly switching to using a Nautilus script. I'll update the post with any findings.

UPDATE 14/06/2008

Nautilus Actions now seems to be working fine with Jaunty. I previously had a beta, upgraded to release version, maybe that was why they were still broken for me. I've since reinstalled. Anyway, it's all working again now! I've noticed that the schema is only applied when right-clicking on an ".avi" file. I'm going to update it so that it can be applied to most video formats (.mpg, .wmv(?), .mov etc...)

UPDATE 26/01/2010

I'm now running Linux Mint 8, and Ubuntu 9.10. I had a few problems with the actions recently. The action attached to this blog won't work if it's imported. It took me little while to figure out, but for the command it's no good just putting "mencoder" any more. You now how to put "/usr/bin/mencoder" which will stop the action showing as red (invalid).

Updated: