Convert OGV to AVI in Linux With OGV-Convert

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.

OGV converter website

Once there, scroll down and click the download button.

Click 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:

ogv-convert

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:

/home/username/.gnome2/nautilus-scripts/

If this folder doesn’t exist already, you can create it with the following command:

mkdir /home/username/.gnome2/nautilus-scripts/

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.

View Script Properties

Now simply make sure the Allow executing file as program option is checked in the Permissions tab.

Execute as Program

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.

Select Script

Then, enter a name for your new video.

Enter New Video Name

You’ll view a progress window as the conversion takes place.  When it’s done, you’ll see confirmation the process is finished.

View Progress

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?

More posts from the Linux Tips Category

01Downloader.jpg

Get the Amazon MP3 Downloader Working In Ubuntu 11.10

Use the Linux ‘dd’ Command With A Simple GUI

01Open_System_Settings-75.jpg

Configure Ubuntu to Not Dim or Turn Off An Inactive Display

01No_Hibernate_Option-75.jpg

Return the Hibernate Option to the Ubuntu 12.04 System Menu

Popular Posts This Month

windows defender

Windows Defender vs. Security Essentials vs Safety Scanner

youtube ie11 freezing

How To Fix Flash Crashes in Internet Explorer 11

bitlocker error

Fix “This device can’t use a Trusted Platform Module” When Enabling BitLocker

Leave a Reply