[FFmpeg-user] ffmpeg makes some sources darker

Andy Furniss adf.lists at gmail.com
Mon Jan 4 23:29:24 CET 2016


Jim Worrall wrote:
>
>> On 2016 Jan 4, at 1:33 PM, Carl Eugen Hoyos <cehoyos at ag.or.at>
>> wrote:
>>
>> How did you produce the screenshots?
> ffmpeg -i in.mkv -vf fps=1/6 %03din.png
>>
>> I do see that one of the png files you uploaded is lighter but when
>> I look at the 91st frame of the file you uploaded, it is darker
>> here with MPlayer, vlc and FFplay (and when I transcode it).
>>
>> Or to say it differently: How do you know it is supposed to be
>> lighter?
> Sorry, I don’t quite understand.  The screenshots from the source are
> brighter than those from the transcode. That’s why I think the
> transcode should be brighter.
>
> The video I uploaded is the source - the bright one - so if it looks
> darker to you than the bright png, maybe I’m doing something wrong.

I think it's because the master is flagged as rec709 but the yuv and I
guess hevc aren't.

Some players (not mplayer) would assume 709 for >= 720p so you wouldn't
notice with them.

It seems ffmpeg swscale/png honors the 709 for the master.

testing -

ffmpeg -i in.mkv -vframes 1  frame1-master.png

ffmpeg -i in.mkv -vframes 1  -vcodec rawvideo -f rawvideo frame1-master.yuv

ffmpeg -f rawvideo -pix_fmt yuv420p -s 1920x1080 -i frame1-master.yuv 
frame1-yuv.png

and frame1-yuv.png is darker than frame1-master.png

do

ffmpeg -f rawvideo -pix_fmt yuv420p -s 1920x1080 -i frame1-master.yuv 
-vf scale=in_color_matrix=bt709  frame1-yuv-709.png

and frame1-yuv-709.png visually (but not md5sum) matches frame1-master.png

so I guess you need to tell hevc that the video is rec709.


More information about the ffmpeg-user mailing list