[FFmpeg-devel] AVFrame.color_trc wrong since f2ad6238e4c0e99e2fc131ee14c586e87b045680

James Almer jamrial at gmail.com
Wed Sep 16 06:24:46 EEST 2020


On 9/15/2020 10:57 PM, Pavel Koshevoy wrote:
> set_side_data used to do out->color_trc =
> s->sei.alternative_transfer.preferred_transfer_characteristics;
> 
> In commit f2ad6238e4c0e99e2fc131ee14c586e87b045680 this was removed.
> Now ffprobe of an HLG stream reports wrong transfer characteristics for
> each frame:
> 
> ```
> $ ffprobe -show_frames 20190914-1435_iowa_vs_iowa-state_fox-cfb-dertp.ts |
> grep color_transfer= | head
> 
> ffprobe version N-99190-g7cc8a2b Copyright (c) 2007-2020 the FFmpeg
> developers
>   built with gcc 8 (Ubuntu 8.4.0-1ubuntu1~16.04.1)
>   configuration: --prefix=/home/xyz/x86_64 --enable-rpath --enable-shared
> --disable-static --disable-stripping --enable-libfreetype
> --enable-libfontconfig --enable-libfribidi --enable-libass
> --enable-libmodplug --enable-openssl --enable-ffnvcodec --enable-cuda
> --extra-ldflags='-L/home/xyz/x86_64/lib -L/usr/local/cuda/lib64'
> --extra-cflags='-I/home/xyz/x86_64/include -I/usr/local/cuda/include'
>   libavutil      56. 59.100 / 56. 59.100
>   libavcodec     58.106.100 / 58.106.100
>   libavformat    58. 56.100 / 58. 56.100
>   libavdevice    58. 11.102 / 58. 11.102
>   libavfilter     7. 87.100 /  7. 87.100
>   libswscale      5.  8.100 /  5.  8.100
>   libswresample   3.  8.100 /  3.  8.100
> [hevc @ 0xb78b00] PPS id out of range: 0
>     Last message repeated 1 times
> [hevc @ 0xb78b00] Error parsing NAL unit #2.
> [hevc @ 0xb78b00] PPS id out of range: 0
>     Last message repeated 1 times
> [hevc @ 0xb78b00] Error parsing NAL unit #2.
> [hevc @ 0xb78b00] PPS id out of range: 0
>     Last message repeated 1 times
> [hevc @ 0xb78b00] Error parsing NAL unit #2.
> [hevc @ 0xb78b00] PPS id out of range: 0
>     Last message repeated 1 times
> [hevc @ 0xb78b00] Error parsing NAL unit #2.
> [hevc @ 0xb78b00] PPS id out of range: 0
>     Last message repeated 1 times
> [hevc @ 0xb78b00] Error parsing NAL unit #2.
> [hevc @ 0xb78b00] PPS id out of range: 0
>     Last message repeated 1 times
> [hevc @ 0xb78b00] Error parsing NAL unit #2.
> [hevc @ 0xb78b00] PPS id out of range: 0
>     Last message repeated 1 times
> [hevc @ 0xb78b00] Error parsing NAL unit #2.
> [mpegts @ 0xb72c40] PES packet size mismatch
> 
> 
> 
> 
> 
> [mpegts @ 0xb72c40] Packet corrupt (stream = 2, dts = 3870328878).
> 
> 
> 
> 
> 
> [mpegts @ 0xb72c40] PES packet size mismatch
> 
> 
> 
> 
> 
> [mpegts @ 0xb72c40] Packet corrupt (stream = 1, dts = 3870334067).
> [mpegts @ 0xb72c40] PES packet size mismatch
> [mpegts @ 0xb72c40] Packet corrupt (stream = 2, dts = 3870328878).
> [mpegts @ 0xb72c40] stream 0 : no PTS found at end of file, duration not set
> Input #0, mpegts, from '20190914-1435_iowa_vs_iowa-state_fox-cfb-dertp.ts':
>   Duration: 00:05:00.05, start: 42703.686200, bitrate: 70429 kb/s
>   Program 1
>     Stream #0:0[0x3ff]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024),
> yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67), 3840x2160 [SAR 1:1 DAR
> 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 59.94 tbc
>     Stream #0:1[0x400](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F),
> 48000 Hz, stereo, fltp, 126 kb/s
>     Stream #0:2[0x401](eng): Audio: eac3 ([129][0][0][0] / 0x0081), 48000
> Hz, 5.1(side), fltp, 384 kb/s
> [hevc @ 0xba2d80] Could not find ref with POC -40
> [hevc @ 0xba2d80] Could not find ref with POC -48
> [hevc @ 0xba2d80] Could not find ref with POC -32
> [hevc @ 0xba2d80] First slice in a frame missing.
>     Last message repeated 34 times
> [aac @ 0xba1200] channel element 2.4 is not allocated
> color_transfer=bt2020-10
> color_transfer=bt2020-10
> color_transfer=bt2020-10
> color_transfer=bt2020-10
> color_transfer=bt2020-10
> color_transfer=bt2020-10
> color_transfer=bt2020-10
> color_transfer=bt2020-10
> color_transfer=bt2020-10
> color_transfer=bt2020-10
> ^C
> 
> ```
> 
> that should be color_transfer=arib-std-b67
> 
> Would anyone object if I restored previous behavior?  I'd prefer avoid
> reimplementing SEI parsing outside of libav just to get the correct
> per-frame color_trc...

Yes, the point of the change was to set color_trc before the frame
buffers were allocated, so a full revert would break that.

Can you share the sample that reproduces this?

> 
> Thank you,
>     Pavel.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 



More information about the ffmpeg-devel mailing list