Open main menu

Video Editing

Revision as of 10:48, 27 March 2009 by Freephile (talk | contribs) (paste from gnhlug discuss)

A huge number of multimedia applications are available in the Free Software world of Linux. See wp:Non-linear editing systems and wp:Comparison of video editing software

Applications

Editing

Get familiar with these editing tools

FFmpeg wp:FFmpeg 
One of, if not the most useful tool in the land of multimedia is FFMPEG.
Transcode wp:Transcode_(software) 
tool is built using the libavcodec library of FFmpeg.
Avidemux wp:Avidemux (wiki
Available in three user interfaces (GTK+, QT4 and cli) for all major operating systems. Avidemux is a free video editor designed for simple cutting, filtering and encoding tasks. It's graphical user interface looks pretty similar to VirtualDub and most features known from VirtualDub are available too. Avidemux natively supports a great number of file types, such as AVI, MPEG, VOB, TS, MP4, ASF, OGM, MKV and FLV. At the same time Avidemux natively supports a wide range of Video/Audio formats, including MPEG-1, MPEG-2, MPEG-4 ASP, H.264/AVC, DV, HuffYUV, MP3, AAC, AC-3 and Vorbis. Tasks can be automated using projects, job queue and powerful scripting capabilities. Video-DVD or (S)VCD compliant streams can be created with easy-to-use "Auto" wizards. Multi-threading is supported! See also: FAQ at doom9
GOPchop 
is a "Graphical MPEG Clipper" - a Linux-based GUI program for removing sections from a video file with the minimum amount of disturbance to the stream. It does this by writing specific "Group of Pictures" (GOP) sections to a new video file. The GOPs will decode correctly and the gaps won't be noticed.
HandBrake mw:HandBrake 
is a software application that can convert MPEG video (including DVD-Video) into a MPEG-4 video file in .mp4, .avi, .ogm, or .mkv containers.
kino wp:Kino_(software) 
Kino is great for working with the DV format and IEEE 1394 (firewire) interfaces
kdenlive wp:Kdenlive 
A nice "pro-sumer" (hobbyist, close to professional needs) tool. Kdenlive has instructions on how to make and add a tutorial to their site, including how to create and upload desktop recordings onto vimeo.com http://kdenlive.org/contribution-manual/how-make-video-tutorial
cinelerra wp:Cinelerra 
is a significant project, aimed at the professional user.

Players

MPlayer wp:MPlayer 
is one of the most essential players in the Free Software world. The project works in tandem with FFmpeg. MPlayer software includes the Mencoder commandline tool
VLC 
vlc is cross-platform and wonderful


Mencoder and ffmpeg examples

If you only want a 5-minute clip, the first thing to do would probably be to throw away the other 55 minutes of video. That should make all your files load much faster. :)

You can extract the part you want with mplayer like this:

$ mencoder -ovc copy -oac copy infile -ss 00:10:09.5 -endpos 00:05:00 -o outfile

"-ovc" means "output video codec", "-oac" means "output audio codec", the "-ss" argument skips ahead to 10 minutes 9.5 seconds into the video, and "-endpos" tells mencoder to transcode exactly 5 minutes. "copy" is a special codec name that tells mplayer to just streamcopy the audio and video streams to output... essentially cutting out the 5-minute segment that you want.

This can also be done with ffmpeg:

$ ffmpeg -acodec copy -vcodec copy -itsoffset -00:10:09.5 -i infile -ss 00:10:09.5 -t 00:05:00 outfile

Note that the "-itsoffset" option must be specified to make sure that A/V timestamps synchronize, and that its value must be the negative of the "-ss" argument.

Note that, for BOTH mencoder and ffmpeg, the order of command-line options and arguments is not just significant, it's HIGHLY significant.

To transcode the video, specify the output codecs as the "-vcodec" and "-acodec" arguments:

$ mencoder -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:acodec=ac3 infile -o outfile

Here, "lavc" means to use one of the libavcodec codecs, specified by the "vcodec" and "acodec" suboptions to the "-lavcopts" option (which specifies options for libavcodec). mencoder has about a bazillion^2 command line options, sub options, sub sub options, and can get quite confusing. ffmpeg can also transcode audio and video streams from one codec to another.

If you want to change the framerate of the video, you can use something like this:

$ mencoder -ofps 25 -oac copy -ovc copy -o outfile infile

Note that, whenever you use "copy" as the codec, mplayer will copy the corresponding stream to the output unmodified. That means it will ignore any filters set up to modify the copied stream. This is a BIG gotcha.

For example:

$ mencoder -oac copy -ovc copy -af volume=10 -o outfile infile

WILL NOT DO what you probably want, because with "-oac copy" the "volume" audio filters (specified with "-af") will be ignored, and the audio in outfile will be at the SAME volume as the audio in infile.

When capturing video in the US, you may also run into problems with video interlacing. Fortunately, mencoder has deinterlacing video filters, for example "-vf pp=lb".


See Also

Video Editing/My Story