There are dozens of ways to convert videos on Linux. Some of them, such as FFmpeg, are command line tools, used only in the Terminal, although programs such as WinFF give those programs a nice user interface and let users check boxes and type in information instead of having to produce the entire output command manually.
Other programs like Avidemux and OpenShot and Pitivi, to name but three, are video editors first, but also allow for simple video conversion. A good option for those wanting an easy way to convert their OGV (Ogg Video) files to something a bit more widely supported outside of Linux, is the simple yet effective script called ogv-convert. In many ways it’s a single-trick pony, but for its simplicity, it does a nice job.
The author of the script mentions using gtk-recordmydesktop, a desktop recording utility that saves its videos in OGV format. Many, if not most, video sharing websites accept AVI or WMV or Flash videos, but probably not ogv. So the author created a simple script that uses mencoder to convert the OGV videos produced by gtk-recordmydesktop into AVI, a format that is patent-encumbered, but is still more widely accepted and supported than OGV.
Of course, you don’t need gtk-recordmydesktop to use the script. And script really is the correct term; this is not a fancy program. It really only has a single purpose, and that is convert videos to avi format, using MPEG4 video and MP3 audio.
You can grab the script from its homepage at GnomeFiles.org.
Once there, scroll down and click the download button.
The script itself will quickly load in your browser window (or in some cases it may download to your hard drive. If it loads in your browser, save it and give it a name, something like:
Note: the name you give isn’t important in this instance, as long as you don’t duplicate the name of a script inside your Nautilus Scripts folder, which is where we’ll eventually be moving the script.
A quick look at the actual script shows how simple a command is used:
convers=$(zenity –entry –text=”Type the name of the converted film with appropriate extension (eg. film.avi)”)
In this first part, all we’re doing is typing in the name of the file the script will eventually produce.
kod=`mencoder $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS.ogv -ovc lavc -oac mp3lame -o $convers` | zenity –progress –text=”Progress…” –percentage=0 –pulsate
The second step is that this information, along with the path to the original file, is given to mencoder (a command line video conversion utility you’ll need to have installed, as well as Zenity, which is used for creating the windows), which then converts the video, using MPEG4 video and MP3 audio, and is given the name the user chose.
To activate the script, we’ll need to put it in our Nautilus Scripts folder. This is a hidden folder (inside the user’s Home directory); the path to it is as follows:
If this folder doesn’t exist already, you can create it with the following command:
Note: you’ll need to replace “username” in the above two instances with your own username.
Once that’s done, you can drag the script into this folder. It will now be available for use. If not, you likely need to change permissions on the script, so your system recognizes it as an executable file. To do this, you’ll need to first right-click the script and choose Properties from the contextual menu.
Now simply make sure the Allow executing file as program option is checked in the Permissions tab.
Once the script is in place, it’s ready to go. Simply highlight a video clip you want to convert, right-click it, then choose ogv-convert (or whatever name you chose), from the Scripts menu.
Then, enter a name for your new video.
You’ll view a progress window as the conversion takes place. When it’s done, you’ll see confirmation the process is finished.
Simple. Nothing to it. You could easily do the same thing by typing the following into a Terminal:
mencoder video.ogv -ovc lavc -oac mp3lame -o video.avi
That’s all the more complicated the conversion is. It doesn’t give the user any controls over bitrate or video quality, and yet it’s actually pretty good and the results were okay. If you want something better, you can easily tweak the command by looking up mencoder parameters and plugging those into the ogv-convert script.
And that’s actually a good starting place for creating your own conversion utilities. You could easily change this so that it converted avi to wmv or mp3 to aac or anything supported by mencoder.
So… ogv-convert is a simple script. But for those using a program, such as gtk-recordmydesktop, that only ouputs in a format – ogv – that not everyone is equipped to use, it’s a good thing. It’s simple, effective, and fast. What more could you want?