[FFmpeg-user] yuv420p to yuv420p10le with x264

wtfux wtfux.dev at googlemail.com
Sat Sep 29 17:41:39 CEST 2012


Hey,
thanks for your help with my previous questions, unfortunately I got
another question.
In the anime fan community it's a common practice to encode 10bit
(yuv420p10le) video with x264 though the source (TV, DVD, BD) is yuv420p.
They claim 10bit video has better quality at the same bitrate as 8bit (e.g.
less banding). But this mail is not about whether that's true or now.
The groups I know all use MeGUI and AviSynth. They do all their magic with
AviSynth (output will still be yuv420p) and pass it to x264 which is built
with bit-depth=10. x264 will then create a yuv420p10le encode.
I however don't use AviSynth but ffmpeg. I used to have ffmpeg built with
x264 support which was compiled with bit-depth=10. ffmpeg always
automatically converted pixfmt yuv420p to yuv420p10le and used x264 to
encode the clip. Because I now need to use x264's qpfile-option which is
only available when piping ffmpeg to x264 I noticed that ffmpeg will now
pass yuv420p to x264 (yuv4mpegpipe) and x264 will internally convert it
to yuv420p10le.
I wonder if there is a difference between having ffmpeg convert to 10bit or
having x264 do that. I heard from some people that x264 will produce a
better output when you feed it with yuv420p and let it
output yuv420p10le than providing yuv420p10le (converted by ffmpeg) as
input. I'm still a newbie at this video stuff and I'm not sure whether I
should believe this. (I tend to not believing this)


And I got a second question to this topic: Sometimes I want to downscale a
video from 1080p to 720p. Should I first convert to yuv420p10le and then
resize or the other way round?
Currently I'm using this command line:

ffmpeg -report -i somevideo8bit.mkv -sws_flags lanczos -vf "scale=1280:720"
-an -f yuv4mpegpipe - | x264 ... --output output10bit,mkv


This will first resize the video, pass it to x264 as yuv420p and x264 will
produce yuv420p10le. I wonder if I should first convert it to yuv420p10le
because 10bit can store more information (which could probably get lost
when downscaling in yuv420p)


Thanks for your help, I want to learn more about all this stuff but I can't
figure out everything by searching the web.


More information about the ffmpeg-user mailing list