Opened 9 months ago

Last modified 9 months ago

#10451 new defect

Reduced luminance and banding artefacts converting DCP JPEG2000 to ProResHQ

Reported by: overlookmotel Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I am trying to convert the video MXF of a DCP (Digital Cinema Package) to ProResHQ. DCPs' MXFs are encoded as JPEG2000 in XYZ colour space, and my intent is to produce a ProResHQ file in Rec709 colour space.

The conversion works, but the output is incorrect in 2 respects:

  1. Luminance is reduced.
  1. In tones close to black, red, blue and green depart from each other and banding artefacts appear in dark areas (dark green blocky splodges).

I am using the latest static build ffmpeg-111332-g9ff834c2a0 from https://evermeet.cx/ffmpeg/ on Mac OS Intel.

% ffmpeg -i input.mxf -c:v prores -profile:v 3 -pix_fmt yuv422p10 -an output.mov

Log:

ffmpeg started on 2023-07-07 at 18:07:47
Report written to "ffmpeg-20230707-180747.log"
Log level: 48
Command line:
/ffmpeg/evermeet/ffmpeg -i "/colour tests/input.mxf" -c:v prores -profile:v 3 -pix_fmt yuv422p10 -an -report "/colour tests/output.mov"
ffmpeg version N-111332-g9ff834c2a0-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2023 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      58. 13.101 / 58. 13.101
  libavcodec     60. 22.100 / 60. 22.100
  libavformat    60. 10.100 / 60. 10.100
  libavdevice    60.  2.101 / 60.  2.101
  libavfilter     9.  8.102 /  9.  8.102
  libswscale      7.  3.100 /  7.  3.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
Splitting the commandline.
Reading option '-i' ... matched as input url with argument '/colour tests/input.mxf'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'prores'.
Reading option '-profile:v' ... matched as option 'profile' (set profile) with argument '3'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv422p10'.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '/colour tests/output.mov' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url /colour tests/input.mxf.
Successfully parsed a group of options.
Opening an input file: /colour tests/input.mxf.
[AVFormatContext @ 0x7f9c11700440] Opening '/colour tests/input.mxf' for reading
[file @ 0x7f9c11700900] Setting default whitelist 'file,crypto,data'
[mxf @ 0x7f9c11700440] Format mxf probed with size=2048 and score=100
[mxf @ 0x7f9c11700440] "OPAtom" with 2 ECs - assuming OP1a
[mxf @ 0x7f9c11700440] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.5a.00
[mxf @ 0x7f9c11700440] Dark key 06.0e.2b.34.01.01.01.02.03.01.02.10.01.00.00.00
[mxf @ 0x7f9c11700440] jpeg2000: Universal Label: 060e2b34.0401.0109.04010202.03010103
[mxf @ 0x7f9c11700440] Before avformat_find_stream_info() pos: 16384 bytes read:66180 seeks:5 nb_streams:1
[mxf @ 0x7f9c11700440] All info found
[mxf @ 0x7f9c11700440] After avformat_find_stream_info() pos: 131131 bytes read:180927 seeks:5 frames:1
Input #0, mxf, from '/colour tests/input.mxf':
  Metadata:
    operational_pattern_ul: 060e2b34.04010101.0d010201.10000000
    uid             : d3425999-446c-4b7e-aad2-16241381926f
    generation_uid  : 8f940296-8fd8-4fc0-8c42-e8a8b1b6c3f0
    company_name    : libdcp
    product_name    : libdcp
    product_version_num: 0.0.0.0.0
    product_version : 1.6.15
    product_uid     : 43059a1d-0432-4101-b83f-736815acf31d
    modification_date: 2021-09-12T23:15:37.000000Z
    toolkit_version_num: 0.1.0.27240.1
    application_platform: linux
    material_package_umid: 0x060A2B340101010501010F2013000000E842DC9189ED41F08337AD2BD43AC6D1
    material_package_name: AS-DCP Material Package
    timecode        : 00:00:00:00
  Duration: 00:00:01.00, start: 0.000000, bitrate: 22167 kb/s
  Stream #0:0, 1, 1/24: Video: jpeg2000 (JPEG 2000 digital cinema 2K), xyz12le(progressive), 1998x1080, SAR 1:1 DAR 37:20, 24 tbr, 24 tbn
    Metadata:
      file_package_umid: 0x060A2B340101010501010F20130000000404C2539D1F4686B35FF25C8F4AF63B
      file_package_name: File Package: SMPTE 429-4 frame wrapping of JPEG 2000 codestreams
      track_name      : Picture Track
Successfully opened the file.
Parsing a group of options: output url /colour tests/output.mov.
Applying option c:v (codec name) with argument prores.
Applying option profile:v (set profile) with argument 3.
Applying option pix_fmt (set pixel format) with argument yuv422p10.
Applying option an (disable audio) with argument 1.
Successfully parsed a group of options.
Opening an output file: /colour tests/output.mov.
[out#0/mov @ 0x7f9c11511c40] No explicit maps, mapping streams automatically...
[vost#0:0/prores @ 0x7f9c11512bc0] Created video stream from input stream 0:0
detected 16 logical cores
[file @ 0x7f9c1151d700] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
  Stream #0:0 -> #0:0 (jpeg2000 (native) -> prores (native))
Press [q] to stop, [?] for help
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[vost#0:0/prores @ 0x7f9c11512bc0] cur_dts is invalid [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[jpeg2000 @ 0x7f9c11514b80] Progression order CPRL
[jpeg2000 @ 0x7f9c11515400] Progression order CPRL
[jpeg2000 @ 0x7f9c11515c80] Progression order CPRL
[jpeg2000 @ 0x7f9c115164c0] Progression order CPRL
[jpeg2000 @ 0x7f9c11516d40] Progression order CPRL
[jpeg2000 @ 0x7f9c115175c0] Progression order CPRL
[jpeg2000 @ 0x7f9c11517e40] Progression order CPRL
[jpeg2000 @ 0x7f9c11518680] Progression order CPRL
[jpeg2000 @ 0x7f9c11518f00] Progression order CPRL
[jpeg2000 @ 0x7f9c11519780] Progression order CPRL
[jpeg2000 @ 0x7f9c1151a000] Progression order CPRL
[jpeg2000 @ 0x7f9c1151a840] Progression order CPRL
[jpeg2000 @ 0x7f9c1151b0c0] Progression order CPRL
[jpeg2000 @ 0x7f9c1151b940] Progression order CPRL
[jpeg2000 @ 0x7f9c1151c1c0] Progression order CPRL
[jpeg2000 @ 0x7f9c1151ca00] Progression order CPRL
[graph 0 input from stream 0:0 @ 0x7f9be33016c0] Setting 'video_size' to value '1998x1080'
[graph 0 input from stream 0:0 @ 0x7f9be33016c0] Setting 'pix_fmt' to value '99'
[graph 0 input from stream 0:0 @ 0x7f9be33016c0] Setting 'time_base' to value '1/24'
[graph 0 input from stream 0:0 @ 0x7f9be33016c0] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x7f9be33016c0] Setting 'frame_rate' to value '24/1'
[graph 0 input from stream 0:0 @ 0x7f9be33016c0] w:1998 h:1080 pixfmt:xyz12le tb:1/24 fr:24/1 sar:1/1
[format @ 0x7f9be3301c00] Setting 'pix_fmts' to value 'yuv422p10le'
[auto_scale_0 @ 0x7f9be3302240] w:iw h:ih flags:'' interl:0
[format @ 0x7f9be3301c00] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0x7f9be3150ec0] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed
[auto_scale_0 @ 0x7f9be3302240] w:1998 h:1080 fmt:xyz12le sar:1/1 -> w:1998 h:1080 fmt:yuv422p10le sar:1/1 flags:0x00000004
Output #0, mov, to '/colour tests/output.mov':
  Metadata:
    operational_pattern_ul: 060e2b34.04010101.0d010201.10000000
    uid             : d3425999-446c-4b7e-aad2-16241381926f
    generation_uid  : 8f940296-8fd8-4fc0-8c42-e8a8b1b6c3f0
    timecode        : 00:00:00:00
    material_package_name: AS-DCP Material Package
    product_version_num: 0.0.0.0.0
    material_package_umid: 0x060A2B340101010501010F2013000000E842DC9189ED41F08337AD2BD43AC6D1
    product_uid     : 43059a1d-0432-4101-b83f-736815acf31d
    modification_date: 2021-09-12T23:15:37.000000Z
    toolkit_version_num: 0.1.0.27240.1
    application_platform: linux
    encoder         : Lavf60.10.100
  Stream #0:0, 0, 1/12288: Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, progressive), 1998x1080 [SAR 1:1 DAR 37:20], q=2-31, 200 kb/s, 24 fps, 12288 tbn
    Metadata:
      file_package_umid: 0x060A2B340101010501010F20130000000404C2539D1F4686B35FF25C8F4AF63B
      file_package_name: File Package: SMPTE 429-4 frame wrapping of JPEG 2000 codestreams
      track_name      : Picture Track
      encoder         : Lavc60.22.100 prores
frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A    
[jpeg2000 @ 0x7f9c11514b80] Progression order CPRL
[prores @ 0x7f9c115239c0] use progressive encoding
[jpeg2000 @ 0x7f9c11515400] Progression order CPRL
[prores @ 0x7f9c11524380] use progressive encoding
[jpeg2000 @ 0x7f9c11515c80] Progression order CPRL
[prores @ 0x7f9c11524d40] use progressive encoding
[jpeg2000 @ 0x7f9c115164c0] Progression order CPRL
[prores @ 0x7f9c11525700] use progressive encoding
[jpeg2000 @ 0x7f9c11516d40] Progression order CPRL
[prores @ 0x7f9c115260c0] use progressive encoding
[jpeg2000 @ 0x7f9c115175c0] Progression order CPRL
[prores @ 0x7f9c11526a80] use progressive encoding
frame=    4 fps=0.0 q=-0.0 size=     768kB time=00:00:00.16 bitrate=37750.6kbits/s speed=0.329x    
[in#0/mxf @ 0x7f9c11700300] EOF while reading input
[in#0/mxf @ 0x7f9c11700300] Terminating demuxer thread
[jpeg2000 @ 0x7f9c11517e40] Progression order CPRL
[prores @ 0x7f9c11527440] use progressive encoding
[jpeg2000 @ 0x7f9c11518680] Progression order CPRL
[prores @ 0x7f9c11527e00] use progressive encoding
[vist#0:0/jpeg2000 @ 0x7f9c11511e00] Decoder thread received EOF packet
[prores @ 0x7f9c115287c0] use progressive encoding
[vist#0:0/jpeg2000 @ 0x7f9c11511e00] Decoder returned EOF, finishing
[vist#0:0/jpeg2000 @ 0x7f9c11511e00] Terminating decoder thread
[prores @ 0x7f9c11524380] use progressive encoding
[prores @ 0x7f9c11526a80] use progressive encoding
frame=    8 fps=7.4 q=-0.0 size=    1792kB time=00:00:00.33 bitrate=44041.2kbits/s speed=0.308x    
[prores @ 0x7f9c11525700] use progressive encoding
[prores @ 0x7f9c11527e00] use progressive encoding
[prores @ 0x7f9c11524d40] use progressive encoding
[prores @ 0x7f9c115260c0] use progressive encoding
[out_0_0 @ 0x7f9be3301b40] EOF on sink link out_0_0:default.
[prores @ 0x7f9c115239c0] use progressive encoding
[prores @ 0x7f9c11527440] use progressive encoding
No more output streams to write to, finishing.
[prores @ 0x7f9c1152cc00] use progressive encoding
[prores @ 0x7f9c1152a500] use progressive encoding
[prores @ 0x7f9c1152c240] use progressive encoding
[prores @ 0x7f9c11529180] use progressive encoding
[prores @ 0x7f9c1152b880] use progressive encoding
[prores @ 0x7f9c1152aec0] use progressive encoding
[prores @ 0x7f9c11529b40] use progressive encoding
[out#0/mov @ 0x7f9c11511c40] All streams finished
[out#0/mov @ 0x7f9c11511c40] Terminating muxer thread
[AVIOContext @ 0x7f9c1151d880] Statistics: 6463176 bytes written, 2 seeks, 28 writeouts
[out#0/mov @ 0x7f9c11511c40] Output file #0 (/colour tests/output.mov):
[out#0/mov @ 0x7f9c11511c40]   Output stream #0:0 (video): 24 frames encoded; 24 packets muxed (6461784 bytes); 
[out#0/mov @ 0x7f9c11511c40]   Total: 24 packets (6461784 bytes) muxed
[out#0/mov @ 0x7f9c11511c40] video:6310kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.021480%
frame=   24 fps= 21 q=-0.0 Lsize=    6312kB time=00:00:00.95 bitrate=53953.5kbits/s speed=0.835x    
[in#0/mxf @ 0x7f9c11700300] Input file #0 (/colour tests/input.mxf):
[in#0/mxf @ 0x7f9c11700300]   Input stream #0:0 (video): 24 packets read (2753448 bytes); 24 frames decoded; 0 decode errors; 
[in#0/mxf @ 0x7f9c11700300]   Total: 24 packets (2753448 bytes) demuxed
[AVIOContext @ 0x7f9c11700b00] Statistics: 2820700 bytes read, 5 seeks

Attachments (5)

input.mxf.zip (2.0 MB ) - added by overlookmotel 9 months ago.
Input DCP MXF file
output.mov.zip (2.4 MB ) - added by overlookmotel 9 months ago.
Output ProRes file
ProRes source.png (86.7 KB ) - added by overlookmotel 9 months ago.
Resolve scopes - original source for DCP
DOM DCP.png (688.6 KB ) - added by overlookmotel 9 months ago.
Resolve scopes - DCP
DOM DCP export annotated.png (184.0 KB ) - added by overlookmotel 9 months ago.
Resolve scopes - FFMPEG output ProRes (annotated)

Change History (6)

by overlookmotel, 9 months ago

Attachment: input.mxf.zip added

Input DCP MXF file

by overlookmotel, 9 months ago

Attachment: output.mov.zip added

Output ProRes file

by overlookmotel, 9 months ago

Attachment: ProRes source.png added

Resolve scopes - original source for DCP

by overlookmotel, 9 months ago

Attachment: DOM DCP.png added

Resolve scopes - DCP

by overlookmotel, 9 months ago

Resolve scopes - FFMPEG output ProRes (annotated)

comment:1 by overlookmotel, 9 months ago

Bug originally noticed in DCP-o-matic (https://dcpomatic.com/) which uses FFMPEG internally, but can be reproduced with FFMPEG alone. DCP-o-matic bug report: https://dcpomatic.com/mantis/view.php?id=2590

Note: See TracTickets for help on using tickets.