Edit Video





Edit Video

Cut and edit video from a number of formats with avidemux.

Like with other multimedia editing, video-editing tools usually fall into either the consumer or the professional user category. There are a number of video-editing tools under Linux, both command line or graphical, and consumer or professional.This hacks covers avidemux, a video-editing tool that is aimed at the consumer level and has plenty of features. I describe how to use this tool to perform basic video editing.

The first step is to download and install the avidemux software. This step varies based on your distribution, but visit the avidemux download page at http://fixounet.free.fr/avidemux/download.html and find the precompiled package for your distribution. If there is no precompiled version, then download the .tar.gz source from the site and follow the installation documentation at http://fixounet.free.fr/avidemux/doc/en/install.xml.html to install the software.

There are very few required libraries for avidemux: it requires GTK+ and glib2.x, libmad, libxml2, and nasmall software that should be readily available on any major Linux distribution. Apart from that, other libraries are optional and only serve to increase avidemux's support for various video and audio formats. [Hack #53] explains how to find and install various extra codecs and libraries for your computer.

Once avidemux is installed, launch it from a menu or type avidemux from a console. The default interface has a lot of widgets, but for general video editing we only need a few of them. First, click File Open and choose the video you wish to edit from the dialog box. avidemux will show you the first frame in the main section of the window. Along the bottom of the window are controls to navigate through the video. You can play through the video, skip through frames forwards or backwards, and set editing points. There's also a general slider bar you can drag to quickly move through the video.

The first time you open an MPEG file, you might be prompted to index the file so that avidemux can keep track of where it is. Say yes to create an .idx file avidemux can use while editing.


With the file open, now is the time to start editing. Editing in avidemux involves finding a frame you want to cut, copy, or delete using the slider or frame skipping buttons, and then setting the beginning (Marker A) or ending (Marker B) editing point. Click Edit Set Marker A to set the starting edit point, move to the end of the section you want to edit, and then click Edit Set Marker B. Once you've set the A and B markers, you need to tell avidemux what you want to do with that selection. All of the editing controls are under the Edit menu, so you can cut, copy, paste, and delete all from this menu. You also can set markers in reverse: just move to the end of a section of video to set marker B first, then move to the beginning and set marker A.

avidemux supports editing only a single track of video at a time, so if you want to add sections from another video, click File Append Video and choose the video from the dialog box. That video will be appended to the current one, and you can then cut and paste from the combined video. You can, however, add a second audio track (so you could, for instance, add a sound track to a home movie). To add a second audio track, click Audio Second Audio Track MP3 File or choose AC3 file if you have audio in that format. Alternatively, you can use audio from a different file to replace the current audio track from the video. Click Audio Source External MPEG (MP2/MP3) to choose a different audio track. You can also choose the audio track from WAV or AC3 files.

To start playback of the current video, click Play Play Video (or the Play button in the main window). You can't skip around in the video while in playback mode, so be sure to move where you want to play beforehand.

When you are ready to save the finished product, it is time to configure the final output. If you are fine with the avidemux's defaults, just click File Save Save Video and choose a filename for the output video. Otherwise, you can edit the output video and audio formats from the sidebar in the main window. avidemux supports a number of audio and video output formats provided you have the corresponding libraries installed. To change which video codec it uses, click the first drop-down menu under the Video header and pick the output format from the list. If you want to resize the video to VCD, SVCD, or DVD resolutions, click the V Filter button and select the resize option you want from the window that appears. Repeat this process for audio options under the Audio header. Finally, choose the container format you want to use under the Outp. fmt header. Then click File Save Save Video to start the video conversion process. avidemux will show a progress bar as it runs through the different encoding and other steps it must perform to save the file.

If you want to save your work as a project that you can open up later, click File Project Save Project and choose a filename for your project. To open that project later, start avidemux and then click File Project Open Project.



 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows