[FFmpeg-user] The internal ffmpeg rgb=>yuv pipeline and conversion matrices

Andy Furniss adf.lists at gmail.com
Mon May 9 19:04:42 CEST 2016


Peter Rabbitson wrote:
> On 05/09/2016 04:34 PM, Andy Furniss wrote:
>>
>> Don't test with color src - use something real and you  may see
>> different.
>>
>
> Nod.
>
> For completeness below is *literally* what my pipeline looks like,
> except of course it isn't "all green". The command as-is produces
> satisfactory results for both the HD and the SD part.

OK, but maybe 601 for sd would be more compatible if players ignore
the 709 meta in the file.

FWIW I tested with an rgb24 png 00AA00 as input like below and
didn't see the any change when playing with mpv - result was
00AA00 whereas before testing with color I got 00AB02 so I guess
there was a double conversion going on there.

>
>
> perl -e '
>    die "Need dimensions" if grep { $_ !~ /^\d+$/ } @ARGV[0,1];
>
>    my $ppm_frame =
>      "P6\n$ARGV[0] $ARGV[1]\n255\n"
>    . pack('C3', 0, 0xAA, 0 ) x ($ARGV[0] * $ARGV[1])
>    ;
>
>    print $ppm_frame while 1;
> ' \
> 1280 \
> 720 \
> | ffmpeg  -y -hide_banner \
>            -r 30 -probesize 32M -f image2pipe -c:v ppm -i /dev/stdin \
>            -filter_complex '
>    [0]
>      scale=out_color_matrix=bt709:out_range=tv,
>      split [sd];
>
>    [sd]
>      scale=320x240
>    ' \
>            -c:v libx264 -colorspace bt709 -pix_fmt yuv444p -profile:v
> high444 \
>            -qp 0 -preset:v ultrafast \
>            -t 5 greenz.mkv
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list