Blog

Posted 2005/08/12

Video editing using Mencoder

Convert to raw avi.
mencoder -ovc raw -ofps 30 -oac pcm out.wmv -o out.avi &> /dev/null
Cut out two sections.
mencoder -ss 150 -endpos 70  -oac copy -ovc copy out.avi -o detach.avi
mencoder -ss 420 -endpos 90  -oac copy -ovc copy out.avi -o splash.avi
Make a 5 second avi from a single jpg.
mkdir frames
for i in `seq 1 150`; do cp text.jpg frames/$i.jpg;done
mencoder "mf://frames/*.jpg" -ofps 30 -ovc raw -oac pcm -o text.avi
Edit the videos together with no sound and compress using a high bitrate.
mencoder -nosound -ovc copy detatch.avi text.avi splash.avi -o combine.avi
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=680:vpass=1 combine.avi -o compress.avi
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=680:vpass=2 combine.avi -o compress.avi