Monthly Archives: March 2012

Command line video editting

Recently I used gtk-recordmydesktop to record a “video class” with both the slides, videos and the teacher appearing at the same time.

After that I had to edit the video. So here’s what I’ve done:

Convert from OGV created by gtk-recordmydestktop to MPEG
mencoder input.ogv -o output.mpg -ovc x264 -oac pcm;

Cut video segments from the beggining to a position at the end (00:15:02) mencoder tmp.mpg -o Parte12.mpg -ovc copy -oac copy -endpos 00:15:02

Cut video from a starting position to the end:
mencoder tmp.mpg -o Parte12.mpg -ovc copy -oac copy -ss 00:05:14

Rescale the video to a certain resolutions:
mencoder nn1.mpg -o tmp.mpg -oac copy -vf scale=1056:800 -ovc x264

Merge several video files into a single video:
mencoder -o ../final.mpg -ovc copy -oac copy

Enhance audio volume and convert to XviD:
ffmpeg -i f.mpg -vcodec msmpeg4v2 -vol 1000 -qscale 5.1 outro.avi

(-qscale adjusts quality. 0 is best but biggest)

If needed, play with higher volume in mplayer:
mplayer -af volume=12:0 Parte1.mpg

More useful information can be found here:
http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs