[x264-devel] ffmpeg to x264 gamma mismatch

Richard Archer rha at juggernaut.com.au
Fri Feb 24 10:17:22 CET 2012


Hi all,

While the list is fielding newbie questions, I have one too!

I have a script which accepts a variety of video formats as input and 
recompresses them to mp4.

I use ffmpeg to convert the video into a y4m stream and pipe it into 
x264. The output is saved as an H.264 stream and then muxed with the 
audio using MP4Box.

Generally this all works very nicely, but when I start with a recording 
from a digital TV broadcast the final video looks washed out, especially 
on Apple devices. I've read about YUV colorspaces being mapped either 
from 0-255 or 16-255 and assume a mismatch of this mapping is the issue 
I'm running into.

The command line my script generates looks something like:

ffmpeg  -i "something.m2v" -r 25.000 -s 720x576 -aspect 16:9 -pix_fmt 
yuv420p -f yuv4mpegpipe -aspect 16:9 - | \
x264 --preset=veryslow --tune=film --no-fast-pskip --aq-strength=0.8 
--psy-rd=0.1:0.05 --crf 22 --demuxer y4m --output "something.264" -

MP4Box -tmp . -add "something.264:fps=25.000:par=64:45" -add 
"something.aac" -add "something.srt:lang=eng:layout=1024x80x0x-1" 
"something.m4v"

Is there a way to tell x264 which colorspace mapping to expect, or to 
tell ffmpeg to output the correct mapping?

I do note that the distro I use has an out of date ffmpeg, although I 
recompile x264 from source every few months.

Thanks so much for any help with this frustrating problem!

  ...Richard.

p.s. I'm not asking for a critique of my x264 settings, but open to 
advice :)




More information about the x264-devel mailing list