[FFmpeg-user] BGR48BE to yuv420p10le conversion - which rgb2yuv coefficients are actually used?

Carl Eugen Hoyos ceffmpeg at gmail.com
Thu May 14 23:07:10 EEST 2020


Am Do., 14. Mai 2020 um 14:51 Uhr schrieb MichaƂ Kudelski
<m.a.kudelski at gmail.com>:

> I am converting 16-bit PNG frames to yuv420p10le (and encoding them to
> HDR10 videos) with the following command:

(I am not convinced that the output is HDR10 but I may misunderstand.)

> ffmpeg \
>     -pix_fmt bgr48be \
>     -framerate 23.976 \
>     -i "${1}%05d${extension}" \
>     -color_primaries 9 \
>     -color_trc 16 \
>     -colorspace 9 \
>     -color_range 1 \
>     -c:v libx265 \
>     -pix_fmt yuv420p10le \
>     -crf 1 \
>     -b:v 0 \
>     output.mkv
>
> It seems to work correct, but I need to reproduce the BGR48BE to
> yuv420p10le conversion outside of the ffmpeg. For this, I need to
> know the underlying rgb2yuv coefficients.

I believe they are set in fill_rgb2yuv_table() in libswscale/utils.c and
you should be able to request different coefficients.

Carl Eugen


More information about the ffmpeg-user mailing list