Opened 3 months ago

#11150 new defect

Issue with processing HEVC Dolby Vision

Reported by: duace Owned by:
Priority: important Component: avformat
Version: git-master Keywords: dolby_vision hevc conversion extraction corruption regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When attempting to process video files containing HEVC Dolby Vision streams, FFMPEG encounters issues that result in corrupted output files.

How to reproduce:

  1. Conversion from MKV to MP4
    • Command:
      % ffmpeg -y -i P7.DT-DL.FEL.mkv -c copy -strict unofficial bad_convert.mp4
      ffmpeg version N-116755-g28ad75c243-ga754ee0844+1 Copyright (c) 2000-2024 the FFmpeg developers
        built with gcc 14.2.0 (Rev1, Built by MSYS2 project)
        configuration:  --pkg-config=pkgconf --cc='ccache gcc' --cxx='ccache g++' --ld='ccache g++' --extra-cxxflags=-fpermissive --extra-cflags=-Wno-int-conversion --disable-autodetect --enable-amf --enable-bzlib --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-iconv --enable-lzma --enable-nvenc --enable-zlib --enable-sdl2 --enable-ffnvcodec --enable-nvdec --enable-cuda-llvm --enable-gmp --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libdav1d --enable-libaom --disable-debug --enable-libfdk-aac --enable-libass --enable-libfreetype --enable-gpl --enable-librav1e --enable-libsvtav1 --enable-libjxl --enable-gnutls --extra-libs=-liconv --enable-version3 --enable-nonfree
        libavutil      59. 34.100 / 59. 34.100
        libavcodec     61. 11.100 / 61. 11.100
        libavformat    61.  5.101 / 61.  5.101
        libavdevice    61.  2.100 / 61.  2.100
        libavfilter    10.  2.102 / 10.  2.102
        libswscale      8.  2.100 /  8.  2.100
        libswresample   5.  2.100 /  5.  2.100
        libpostproc    58.  2.100 / 58.  2.100
      Input #0, matroska,webm, from 'P7.DT-DL.FEL.mkv':
        Metadata:
          encoder         : libebml v1.4.5 + libmatroska v1.7.1
        Duration: 00:00:25.61, start: 0.000000, bitrate: 77914 kb/s
        Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
            Metadata:
              BPS             : 69000121
              DURATION        : 00:00:25.609000000
              NUMBER_OF_FRAMES: 614
              NUMBER_OF_BYTES : 220878013
              _STATISTICS_WRITING_APP: mkvmerge v83.0 ('Circle Of Friends') 64-bit
              _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        Stream #0:1: Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
            Metadata:
              BPS             : 9255056
              DURATION        : 00:00:24.650000000
              NUMBER_OF_FRAMES: 591
              NUMBER_OF_BYTES : 28517144
              _STATISTICS_WRITING_APP: mkvmerge v83.0 ('Circle Of Friends') 64-bit
              _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
            Side data:
              DOVI configuration record: version: 1.0, profile: 7, level: 6, rpu flag: 1, el flag: 1, bl flag: 0, compatibility id: 6, compression: 0
      Stream mapping:
        Stream #0:0 -> #0:0 (copy)
      Output #0, mp4, to 'corrupt_out.mp4':
        Metadata:
          encoder         : Lavf61.5.101
        Stream #0:0: Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 16k tbn (default)
            Metadata:
              BPS             : 69000121
              DURATION        : 00:00:25.609000000
              NUMBER_OF_FRAMES: 614
              NUMBER_OF_BYTES : 220878013
              _STATISTICS_WRITING_APP: mkvmerge v83.0 ('Circle Of Friends') 64-bit
              _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      Press [q] to stop, [?] for help
      [vost#0:0/copy @ 000001f8f7950480] Invalid DTS: 1968 PTS: 1328, replacing by guess
      [vost#0:0/copy @ 000001f8f7950480] Non-monotonic DTS; previous: 1328, current: 672; changing to 1329. This may result in incorrect timestamps in the output file.
      [vost#0:0/copy @ 000001f8f7950480] Non-monotonic DTS; previous: 1329, current: 1328; changing to 1330. This may result in incorrect timestamps in the output file.
      [out#0/mp4 @ 000001f8f7283280] video:215701KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.006229%
      frame=  614 fps=0.0 q=-1.0 Lsize=  215715KiB time=00:00:25.48 bitrate=69345.6kbits/s speed=52.1x
      
    • Actual Behavior: FFMPEG generates a corrupted MP4 file that fails to play correctly. The video stream does not play in standard media players, acting as if it's disabled.
    • FFprobe output:
      [extract_extradata @ 000001f76173b180] No start code is found.
      corrupt_out.mp4: Invalid data found when processing input
      
    • Despite this, the output file has the correct metadata.
  1. Extraction of a Segment
    • Command: ffmpeg -y -ss 00:00:10 -i P7.DT-DL.FEL.mp4 -t 5 -map 0 -c copy -strict unofficial bad_extract.mp4
    • Actual Behavior: The conversion completes without any warnings/errors, however the resulting MP4 file is also corrupted, and FFprobe output is the same as in the previous case.
  1. Conversion from MP4 to MKV
    • Command:
      % ffmpeg -y -i P7.DT-DL.FEL.mp4 -c copy -strict unofficial bad_convert.mkv
      ffmpeg version N-116755-g28ad75c243-ga754ee0844+1 Copyright (c) 2000-2024 the FFmpeg developers
        built with gcc 14.2.0 (Rev1, Built by MSYS2 project)
        configuration:  --pkg-config=pkgconf --cc='ccache gcc' --cxx='ccache g++' --ld='ccache g++' --extra-cxxflags=-fpermissive --extra-cflags=-Wno-int-conversion --disable-autodetect --enable-amf --enable-bzlib --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-iconv --enable-lzma --enable-nvenc --enable-zlib --enable-sdl2 --enable-ffnvcodec --enable-nvdec --enable-cuda-llvm --enable-gmp --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libdav1d --enable-libaom --disable-debug --enable-libfdk-aac --enable-libass --enable-libfreetype --enable-gpl --enable-librav1e --enable-libsvtav1 --enable-libjxl --enable-gnutls --extra-libs=-liconv --enable-version3 --enable-nonfree
        libavutil      59. 34.100 / 59. 34.100
        libavcodec     61. 11.100 / 61. 11.100
        libavformat    61.  5.101 / 61.  5.101
        libavdevice    61.  2.100 / 61.  2.100
        libavfilter    10.  2.102 / 10.  2.102
        libswscale      8.  2.100 /  8.  2.100
        libswresample   5.  2.100 /  5.  2.100
        libpostproc    58.  2.100 / 58.  2.100
      Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'P7.DT-DL.FEL.mp4':
        Metadata:
          major_brand     : mp42
          minor_version   : 1
          compatible_brands: mp42dby1isom
          creation_time   : 2024-05-04T19:09:51.000000Z
        Duration: 00:00:25.61, start: 0.000000, bitrate: 78241 kb/s
        Stream #0:0[0x1](und): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 69000 kb/s, 23.98 fps, 23.98 tbr, 24k tbn (default)
            Metadata:
              creation_time   : 2024-05-04T19:09:51.000000Z
              handler_name    : video handler
              vendor_id       : [0][0][0][0]
              encoder         : HEVC Coding
        Stream #0:1[0x2](und): Video: hevc (Main 10) (dvhe / 0x65687664), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x1080 [SAR 1:1 DAR 16:9], 9234 kb/s, 23.98 fps, 23.98 tbr, 24k tbn
            Metadata:
              creation_time   : 2024-05-04T19:09:51.000000Z
              handler_name    : video handler
              vendor_id       : [0][0][0][0]
              encoder         : DOVI Coding
            Side data:
              DOVI configuration record: version: 1.0, profile: 7, level: 6, rpu flag: 1, el flag: 1, bl flag: 0, compatibility id: 6, compression: 0
      Stream mapping:
        Stream #0:0 -> #0:0 (copy)
      [out#0/matroska @ 000002bbf2f79280] Could not write header (incorrect codec parameters ?): Invalid data found when processing input
      Conversion failed!
      
    • Actual Behavior: FFMPEG fails to write the output file with the error.

Environment:

  • FFMPEG version: N-116755-g28ad75c243-ga754ee0844+1 (built on Windows 11 23H2 with ​Media Autobuild Suite)
  • Input file: P7.DT-DL.FEL.mkv and P7.DT-DL.FEL.mp4 (Dolby Vision HEVC video)
  • Output file: bad_extract.mp4 and bad_convert.mp4 (Corrupted video)

Additional Information:

Change History (0)

Note: See TracTickets for help on using tickets.