Archived:MEncoder-V4L

From LinuxTVWiki
Revision as of 22:47, 19 April 2005 by Liontooth (talk | contribs)
Jump to navigation Jump to search

In some recent versions of mencoder, the default framerate for ntsc with the following command comes out as 29 instead of 29.97:

 mencoder -tv driver=v4l2:width=720:height=480:norm=ntsc -ovc lavc -lavcopts vcodec=mpeg4:vhq -oac mp3lame \
 -lameopts cbr:br=128 -endpos 30 -o outfile.mpg tv:// > /dev/null

This is using Christian Marillat's unofficial package of mencoder for Debian amd64, mencoder_1.0-pre7-0.0_amd64.deb and may or may not apply to other versions.

The fact that the framerate is slightly off is not noticeable in playback, and has been the case for at least three months, from January 2005. What is new is that the latest mencoder version usefully reports "Skipping frame!" once a second during recording. The workaround is to set the framerate explicitly with -fps 29.97.

In addition, in the most recent version of mencoder, the default codec for mpeg is FMP4, while it used to be DIVX. To reset it to DIVX, use the -ffourcc DIVX option.

The full command gives great results as before, overriding the poor defaults:

 mencoder -tv driver=v4l2:width=720:height=480:norm=ntsc -ffourcc DIVX -fps 29.97 -ovc lavc \ 
 -lavcopts vcodec=mpeg4:vhq -oac mp3lame -lameopts cbr:br=128 -endpos 30 -o outfile.mpg tv:// > /dev/null

For unofficial packages of mencoder for Debian, see Christian Marillat's Debian Repositories.

I don't have a TV card on a x86 machine or other platforms and can't report on whether the same tweaks are required there.

Dave