Opened 8 years ago

Closed 6 years ago

#5671 closed defect (fixed)

FFmpeg unable to decode PCM in MXF

Reported by: Steve Dierker Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mxf regression
Cc: Michael Niedermayer, lvml@5t9.de Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
FFmpeg is unable to decode PCM which is wrapped in an MXF file. The MXF file is Avid compatible, but was apparently not created with Avid.
Sample can be found here:
http://dl.flavoursys.com/samples/ffmpeg/TVOKids_6.mxf

How to reproduce:

% $ ffmpeg -i TVOKids_6.mxf -loglevel debug -y out.wav                                                                                                                                                                                                 [17:02:14]
ffmpeg version N-80780-gd693392 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2.1) 20160413
  configuration: --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-version3 --enable-libfdk-aac --enable-libx264 --enable-libfreetype
  libavutil      55. 27.100 / 55. 27.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 40.101 / 57. 40.101
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 46.102 /  6. 46.102
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'TVOKids_6.mxf'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'out.wav' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file TVOKids_6.mxf.
Successfully parsed a group of options.
Opening an input file: TVOKids_6.mxf.
[file @ 0x362acc0] Setting default whitelist 'file,crypto'
[mxf @ 0x362a380] Format mxf probed with size=2048 and score=100
[mxf @ 0x362a380] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.23.00
[mxf @ 0x362a380] Dark key 06.0e.2b.34.01.01.01.02.03.01.02.10.01.00.00.00
    Last message repeated 2 times
[mxf @ 0x362a380] Dark key 06.0e.2b.34.02.05.01.01.0d.01.02.01.01.11.01.00
[mxf @ 0x362a380] none: Universal Label: 00000000.0000.0000.00000000.00000000
[mxf @ 0x362a380] Before avformat_find_stream_info() pos: 32744 bytes read:66172 seeks:5 nb_streams:1
[mxf @ 0x362a380] IndexSID 1 segment at 0 missing EditUnitByteCount and IndexEntryArray
[mxf @ 0x362a380] After avformat_find_stream_info() pos: 32744 bytes read:66172 seeks:5 frames:0
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, mxf, from 'TVOKids_6.mxf':
  Metadata:
    uid             : 27023931-e9a3-4549-946d-a5aea01cec3e
    generation_uid  : bd18e86b-ee7a-4f8f-8ceb-7ab5ac3f175f
    company_name    : Matrox Electronic
    product_name    : DSX
    product_version : 4.0
    product_uid     : 060e2b34-0401-0109-0e0e-010101000001
    modification_date: 2016-05-31 17:30:17
    material_package_umid: 0x060A2B340101010501010D20130000004F5296D2A16741ED9D11A972EA7C9C30
    material_package_name: 0004PE
    timecode        : 11:22:33;00
  Duration: 00:00:18.95, start: 0.000000, bitrate: 1166 kb/s
    Stream #0:0, 0, 1/48000: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D20130000000B45AF7186674D708C09A0FCF3D5B364
Successfully opened the file.
Parsing a group of options: output file out.wav.
Successfully parsed a group of options.
Opening an output file: out.wav.
[file @ 0x3631540] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 16 logical cores
[graph 0 input from stream 0:0 @ 0x3643980] Setting 'time_base' to value '1/48000'
[graph 0 input from stream 0:0 @ 0x3643980] Setting 'sample_rate' to value '48000'
[graph 0 input from stream 0:0 @ 0x3643980] Setting 'sample_fmt' to value 's32'
[graph 0 input from stream 0:0 @ 0x3643980] Setting 'channel_layout' to value '0x4'
[graph 0 input from stream 0:0 @ 0x3643980] tb:1/48000 samplefmt:s32 samplerate:48000 chlayout:0x4
[audio format for output stream 0:0 @ 0x3644560] Setting 'sample_fmts' to value 's16'
[audio format for output stream 0:0 @ 0x3644560] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:0'
[AVFilterGraph @ 0x3631b80] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 0x3645d40] [SWR @ 0x3646120] Using fltp internally between filters
[auto-inserted resampler 0 @ 0x3645d40] ch:1 chl:mono fmt:s32 r:48000Hz -> ch:1 chl:mono fmt:s16 r:48000Hz
[wav @ 0x362fa00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, wav, to 'out.wav':
  Metadata:
    uid             : 27023931-e9a3-4549-946d-a5aea01cec3e
    generation_uid  : bd18e86b-ee7a-4f8f-8ceb-7ab5ac3f175f
    company_name    : Matrox Electronic
    product_name    : DSX
    product_version : 4.0
    product_uid     : 060e2b34-0401-0109-0e0e-010101000001
    modification_date: 2016-05-31 17:30:17
    material_package_umid: 0x060A2B340101010501010D20130000004F5296D2A16741ED9D11A972EA7C9C30
    material_package_name: 0004PE
    ISMP            : 11:22:33;00
    ISFT            : Lavf57.40.101
    Stream #0:0, 0, 1/48000: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s16 (24 bit), 768 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D20130000000B45AF7186674D708C09A0FCF3D5B364
      encoder         : Lavc57.48.101 pcm_s16le
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s24le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mxf @ 0x362a380] IndexSID 1 segment at 0 missing EditUnitByteCount and IndexEntryArray
TVOKids_6.mxf: Invalid data found when processing input
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[output stream 0:0 @ 0x36444c0] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (TVOKids_6.mxf):
  Input stream #0:0 (audio): 0 packets read (0 bytes); 0 frames decoded (0 samples); 
  Total: 0 packets (0 bytes) demuxed
Output file #0 (out.wav):
  Output stream #0:0 (audio): 0 frames encoded (0 samples); 0 packets muxed (0 bytes); 
  Total: 0 packets (0 bytes) muxed
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x3631640] Statistics: 4 seeks, 3 writeouts
[AVIOContext @ 0x3633020] Statistics: 66172 bytes read, 5 seeks

Attachments (1)

TVOKids_6_cut.mxf (2.4 MB ) - added by Carl Eugen Hoyos 8 years ago.

Change History (8)

comment:1 by Carl Eugen Hoyos, 8 years ago

Component: undeterminedavformat
Keywords: mxf regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Summary: FFMpeg unable to decode PCM in MXF wrapperFFmpeg unable to decode PCM in MXF
Version: unspecifiedgit-master

by Carl Eugen Hoyos, 8 years ago

Attachment: TVOKids_6_cut.mxf added

comment:2 by Michael Niedermayer, 8 years ago

Cc: Michael Niedermayer added

comment:3 by lvml, 8 years ago

The same bug applies to MXF files from other sources, e.g. the soundtrack of "Meridian", a professionally made 4k HDR video sample that Netflix recently published under a Creative Commons license for the purpose of video encoder testing.

The Meridian MXF files are available e.g. from the xiph.org site at https://media.xiph.org/video/derf/

When trying to probe https://media.xiph.org/video/derf/meridian/MERIDIAN_SHR_C_EN-XX_US-NR_51_LTRT_UHD_20160909_OV/MERIDIAN_SHR_C_EN-XX_US-NR_51_LTRT_UHD_20160909_OV_01_EN_20_B.mxf with ffprobe compiled from the current git master, the output looks like this:

[mxf @ 0x227ae20] OPAtom misinterpreted as OP1a? KLV for edit unit 0 extending into next edit unit is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mxf @ 0x227ae20] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Input #0, mxf, from 'MERIDIAN_SHR_C_EN-XX_US-NR_51_LTRT_UHD_20160909_OV_01_EN_20_B.mxf':
  Metadata:
    application_platform: Microsoft Windows 7 Professional Service Pack 1 (Build 7601)
    uid             : cdb57bb1-4f06-4c77-64e4-c0293f2c7163
    generation_uid  : 2d654592-04ae-4cf4-35ab-69707dc0de3a
    company_name    : Colorfront
    product_name    : Transkoder
    product_uid     : 3a4fe380-0d01-11e4-869f-3cd92b5c1dfc
    product_version : 2.7.3.20150121
    modification_date: 2016-09-09 11:29:38
    material_package_umid: 0x060A2B340101010501010F20130000002C3E49A0BD1548ACD65D70EA10FAEB6B
    timecode        : 00:00:17;12
  Duration: 00:11:58.92, start: 0.000000, bitrate: 2304 kb/s
    Stream #0:0: Audio: pcm_s24le, 48000 Hz, 2 channels, s32 (24 bit), 2304 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010F2013000000AE2179BC93E24600C47112668D9E21FB

When trying to transcode the PCM audio track in the same MXF file with "ffmpeg" from current git master, the output looks like this:

./ffmpeg -i MERIDIAN_SHR_C_EN-XX_US-NR_51_LTRT_UHD_20160909_OV_01_EN_20_B.mxf test.wav
ffmpeg version N-81773-g69449da Copyright (c) 2000-2016 the FFmpeg developers
...
[mxf @ 0x20f1660] OPAtom misinterpreted as OP1a? KLV for edit unit 0 extending into next edit unit is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[mxf @ 0x20f1660] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, mxf, from 'MERIDIAN_SHR_C_EN-XX_US-NR_51_LTRT_UHD_20160909_OV_01_EN_20_B.mxf':
  Metadata:
    application_platform: Microsoft Windows 7 Professional Service Pack 1 (Build 7601)
    uid             : cdb57bb1-4f06-4c77-64e4-c0293f2c7163
    generation_uid  : 2d654592-04ae-4cf4-35ab-69707dc0de3a
    company_name    : Colorfront
    product_name    : Transkoder
    product_uid     : 3a4fe380-0d01-11e4-869f-3cd92b5c1dfc
    product_version : 2.7.3.20150121
    modification_date: 2016-09-09 11:29:38
    material_package_umid: 0x060A2B340101010501010F20130000002C3E49A0BD1548ACD65D70EA10FAEB6B
    timecode        : 00:00:17;12
  Duration: 00:11:58.92, start: 0.000000, bitrate: 2304 kb/s
    Stream #0:0: Audio: pcm_s24le, 48000 Hz, stereo, s32 (24 bit), 2304 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010F2013000000AE2179BC93E24600C47112668D9E21FB
Output #0, wav, to 'test.wav':
  Metadata:
    application_platform: Microsoft Windows 7 Professional Service Pack 1 (Build 7601)
    uid             : cdb57bb1-4f06-4c77-64e4-c0293f2c7163
    generation_uid  : 2d654592-04ae-4cf4-35ab-69707dc0de3a
    company_name    : Colorfront
    product_name    : Transkoder
    product_uid     : 3a4fe380-0d01-11e4-869f-3cd92b5c1dfc
    product_version : 2.7.3.20150121
    modification_date: 2016-09-09 11:29:38
    material_package_umid: 0x060A2B340101010501010F20130000002C3E49A0BD1548ACD65D70EA10FAEB6B
    ISMP            : 00:00:17;12
    ISFT            : Lavf57.44.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010F2013000000AE2179BC93E24600C47112668D9E21FB
      encoder         : Lavc57.58.100 pcm_s16le
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s24le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

Whatever options I tried, the result is always "an empty output file".

comment:4 by lvml, 8 years ago

Cc: lvml@5t9.de added

comment:5 by Carl Eugen Hoyos, 8 years ago

I opened ticket #5866 for the regression decoding the xiph sample.

comment:7 by Marton Balint, 6 years ago

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