Opened 5 years ago

Closed 4 years ago

#8610 closed defect (fixed)

HEVC: bad value for color_trc with more than one decoding thread

Reported by: charlymp Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: hevc, color_trc
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When an HEVC stream using an alternative_transfer_characteristics SEI is decoded, the AVCodecContext::color_trc and AVFrame::color_trc values depends of the number of decoding threads used but the analyse and the first decoded frame are always ok.

Examples (where arib-std-b67 is the expected value):

ffplay bbb_hevc.ts -threads 1 -vf showinfo
ffplay version N-97220-gcd04bb4afe Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --disable-static --enable-shared --enable-optimizations --disable-debug --enable-avfilter --enable-avformat --enable-avcodec --enable-avutil --enable-swresample --enable-swscale --enable-postproc --enable-nonfree --enable-version3 --enable-logging --disable-cuda --disable-cuvid --disable-nvenc --enable-libx264 --enable-gpl --enable-libass --enable-libzvbi --enable-libx265 --enable-libdav1d
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 77.101 / 58. 77.101
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, mpegts, from '/mnt/data/bbb_hevc.ts':KB sq=    0B f=0/0   
  Duration: 00:01:16.76, start: 1.483333, bitrate: 3002 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (Main 10) (HEVC / 0x43564548), yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67), 1280x720 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 90k tbn, 24 tbc
    Stream #0:1[0x101](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, 5.1, fltp, 383 kb/s
[Parsed_showinfo_0 @ 0x7fb3700a7700] config in time_base: 1/90000, frame_rate: 24/1
[Parsed_showinfo_0 @ 0x7fb3700a7700] config out time_base: 0/0, frame_rate: 0/0
[Parsed_showinfo_0 @ 0x7fb3700a7700] n:   0 pts: 133500 pts_time:1.48333 pos:      564 fmt:yuv420p10le sar:1/1 s:1280x720 i:P iskey:1 type:I checksum:6305498E plane_checksum:[627338BC DF8E0869 DF8E0869] mean:[64 512 512] stdev:[0.0 0.0 0.0]
[Parsed_showinfo_0 @ 0x7fb3700a7700] color_range:tv color_space:bt2020nc color_primaries:bt2020 color_trc:arib-std-b67
[Parsed_showinfo_0 @ 0x7fb3700a7700] n:   1 pts: 137250 pts_time:1.525   pos:    31396 fmt:yuv420p10le sar:1/1 s:1280x720 i:P iskey:0 type:B checksum:6305498E plane_checksum:[627338BC DF8E0869 DF8E0869] mean:[64 512 512] stdev:[0.0 0.0 0.0]
[Parsed_showinfo_0 @ 0x7fb3700a7700] color_range:tv color_space:bt2020nc color_primaries:bt2020 color_trc:bt2020-10
[Parsed_showinfo_0 @ 0x7fb3700a7700] n:   2 pts: 141000 pts_time:1.56667 pos:    15792 fmt:yuv420p10le sar:1/1 s:1280x720 i:P iskey:0 type:P checksum:6305498E plane_checksum:[627338BC DF8E0869 DF8E0869] mean:[64 512 512] stdev:[0.0 0.0 0.0]
[Parsed_showinfo_0 @ 0x7fb3700a7700] color_range:tv color_space:bt2020nc color_primaries:bt2020 color_trc:bt2020-10
[Parsed_showinfo_0 @ 0x7fb3700a7700] n:   3 pts: 144750 pts_time:1.60833 pos:    47000 fmt:yuv420p10le sar:1/1 s:1280x720 i:P iskey:0 type:P checksum:BD43CDAC plane_checksum:[F9D4BCDA DF8E0869 DF8E0869] mean:[68 512 512] stdev:[0.9 0.0 0.0]
ffplay bbb_hevc.ts -threads 1 -vf showinfo
ffplay version N-97220-gcd04bb4afe Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --disable-static --enable-shared --enable-optimizations --disable-debug --enable-avfilter --enable-avformat --enable-avcodec --enable-avutil --enable-swresample --enable-swscale --enable-postproc --enable-nonfree --enable-version3 --enable-logging --disable-cuda --disable-cuvid --disable-nvenc --enable-libx264 --enable-gpl --enable-libass --enable-libzvbi --enable-libx265 --enable-libdav1d
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 77.101 / 58. 77.101
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, mpegts, from '/mnt/data/bbb_hevc.ts':KB sq=    0B f=0/0   
  Duration: 00:01:16.76, start: 1.483333, bitrate: 3002 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (Main 10) (HEVC / 0x43564548), yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67), 1280x720 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 90k tbn, 24 tbc
    Stream #0:1[0x101](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, 5.1, fltp, 383 kb/s
[Parsed_showinfo_0 @ 0x7f0e28b20e40] config in time_base: 1/90000, frame_rate: 24/1
[Parsed_showinfo_0 @ 0x7f0e28b20e40] config out time_base: 0/0, frame_rate: 0/0
[Parsed_showinfo_0 @ 0x7f0e28b20e40] n:   0 pts: 133500 pts_time:1.48333 pos:      564 fmt:yuv420p10le sar:1/1 s:1280x720 i:P iskey:1 type:I checksum:6305498E plane_checksum:[627338BC DF8E0869 DF8E0869] mean:[64 512 512] stdev:[0.0 0.0 0.0]
[Parsed_showinfo_0 @ 0x7f0e28b20e40] color_range:tv color_space:bt2020nc color_primaries:bt2020 color_trc:arib-std-b67
[Parsed_showinfo_0 @ 0x7f0e28b20e40] n:   1 pts: 137250 pts_time:1.525   pos:    31396 fmt:yuv420p10le sar:1/1 s:1280x720 i:P iskey:0 type:B checksum:6305498E plane_checksum:[627338BC DF8E0869 DF8E0869] mean:[64 512 512] stdev:[0.0 0.0 0.0]
[Parsed_showinfo_0 @ 0x7f0e28b20e40] color_range:tv color_space:bt2020nc color_primaries:bt2020 color_trc:arib-std-b67
[Parsed_showinfo_0 @ 0x7f0e28b20e40] n:   2 pts: 141000 pts_time:1.56667 pos:    15792 fmt:yuv420p10le sar:1/1 s:1280x720 i:P iskey:0 type:P checksum:6305498E plane_checksum:[627338BC DF8E0869 DF8E0869] mean:[64 512 512] stdev:[0.0 0.0 0.0]

Attachments (1)

bbb_hevc.ts (860.3 KB ) - added by charlymp 5 years ago.
test sample

Download all attachments as: .zip

Change History (2)

by charlymp, 5 years ago

Attachment: bbb_hevc.ts added

test sample

comment:1 by James, 4 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.