MEncoder reference -- x264 edition
Refs:
FFmpeg and MPlayer must have merged their projects, as the parameter docs
for both seem to be the same output now; and it's mencoder-style.
H.264 has some pretty complicated stuff, so there's no point in going on
about every option. Instead, you should probably just read the -x264encopts
section of the mencoder man page -- every time you start an encoding.
Of particular insterest are: crf qp weightp subq deadzone_inter
-of lavf
(default format is just avi, lavf autodetects
by your extension)
x264: global_header
(you need it for iPod/PSP)
So, everything gets done for you now. To get an mp4, with h.264 video and
mp3 audio, just pass preset parameters for what kind of encode job you want:
Notes: format (mp4) is detected; 3-pass is actual 3-pass with x264
-
mencoder -of lavf -oac mp3lame -lameopts preset=standard -ovc x264 -x264encopts preset=slow:tune=animation:b_adapt:bitrate=2048:pass=1 -o "$q.mp4" $q
-
mencoder -of lavf -oac mp3lame -lameopts preset=standard -ovc x264 -x264encopts preset=slow:tune=animation:b_adapt:bitrate=2048:pass=3 -o "$q.mp4" $q
... etc, for each additional pass you decide is warranted.
But here's the thing: multi-pass is only for assuring constant *size* (e.g.
cram it into 2040kbps). If you just want constant quality, you could just
use crf mode; in that case, you get the quality you want, in one pass.
mencoder -of lavf -oac mp3lame -lameopts preset=standard -ovc x264 -x264encopts preset=slow:tune=animation:b_adapt:crf=22 -o "$q.mp4" $q
Pass 1 (no qpel) for an MPEG-2 source, with the "filmdint" filter
(de-telecine, de-interlace, etc), and a framerate hack, in case output
framerate is bad. (Check your output.) Also scales the video to 320x240.
mencoder -of lavf -oac mp3lame -lameopts preset=standard -ovc x264 -x264encopts preset=slow:tune=animation:b_adapt:pass=1 -vf filmdint,scale=320:240,hqdn3d=2:1:2 -fps 29.97 -ofps 23.976 -o "$q.mp4" $q
Pass 1, same as above, but with a crop/scale combination more suitable for a
DVD video. (A lot of them seem to have little borders at the edges.) The FPS
hack seems to be safe on DVDs, and ALWAYS remember to de-interlace!
mencoder -of lavf -oac mp3lame -ovc x264 -x264encopts preset=slow:tune=animation:b_adapt:pass=1 -lameopts preset=standard -vf filmdint,crop=704:464:8:6,scale=624:348,hqdn3d=2:1:2 -fps 29.97 -ofps 23.976 -o "$q.mp4" $q
Some iPod/PSP-specific options: baseline profile is needed (read the manual!)
global_header saves a little space, dsize=::0 will auto-scale y to fit the
aspect for x, while scale=-8 keeps the scale a multiple of 8
mencoder -vf dsize=480:320:0,scale=-8:-8,harddup -oac faac -faacopts mpeg=4:object=2:raw:br=128 -of lavf -lavfopts format=mp4 -ovc x264 -x264encopts profile=baseline:global_header -o "$q.mp4" $q
Updated 2013.06.08
Copyright © 1994 - 2014 UltrX corp. All rights reserved.