[MPlayer-users] Produce 422 format pixels with mencoder for mpeg4-encoding

Krzysztof Duchnowski amidk75 at gmail.com
Mon Dec 16 02:38:32 CET 2013


On 15.12.2013 17:30, James Board wrote:
>>> Also, I plan on using mencoder and libx264 to produce MPEG-4
>>> AVC files and 422-format pixels.  Can ffmpeg do  this?

>> ffmpeg -i input.mp4 -vf
>> scale="'if(gt(a,16/9),1280,-1)':'if(gt(a,16/9),-1,720)',pad=ceil(iw/16)*16:ceil(ih/16)*16:(ow-iw)/2:(oh-ih)/2:black"
>> -f yuv4mpegpipe - | x264 --demuxer y4m --profile high422
>> --preset slow
>> --tune film -qp 0 --output-csp i422 -o output.mp4

> I tried this and the error message was:
>     x264 [error]: invalid argument  qp = p

man x264 would tell you that I've made typo and it should be a "--qp"
instead of "-qp" option.

And another thing - seems that profile "high422" doesn't support
lossless encoding, so it needs to be "--qp 1" at most instead of "--qp 0".
"--profile high444" only support lossless encoding.
Of course, you can encode without setting a profile, but then x264 will
set profile to yuv444 themselves.

Another thing, with previous command I've padded video to multiply of 16
- it produces 1088p resolution instead of 1080p.

So, new command:
ffmpeg -i input.mp4 -vf
"scale='if(gt(a,16/9),1280,-1)':'if(gt(a,16/9),-1,720)',pad=ceil(iw/8)*8:ceil(ih/8)*8:(ow-iw)/2:(oh-ih)/2"
-f yuv4mpegpipe - | x264 --demuxer y4m --profile high444 --preset slow
--qp 0 --output-csp i422 -o output.mp4 -

PS: I prefer to encode with x264 cli command, to have access to it's
native encoding options instead of ffmpeg/mencoder specific one.

-- 
Krzysztof 'DK75' Duchnowski
GetFirefox - http://www.getfirefox.net/
Konfiguracja UTF-8 dla czytników - http://evil.pl/pip/utf/


More information about the MPlayer-users mailing list