Opened 3 years ago

Closed 3 years ago

#5312 closed defect (invalid)

error: unspecified pixel format for j2k 10 bit file

Reported by: gemil Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mxf j2k
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

% ffplay j2ktest.mxf
ffmpeg version 3.0
built on debian 7

Attachments (2)

ffplay-20160308-125219.log (13.2 KB) - added by gemil 3 years ago.
frame.j2k (407.4 KB) - added by cehoyos 3 years ago.

Download all attachments as: .zip

Change History (21)

Changed 3 years ago by gemil

comment:1 Changed 3 years ago by gemil

added files j2ktest.txt and j2ktest.mxf to ftp server

Changed 3 years ago by cehoyos

comment:2 Changed 3 years ago by cehoyos

  • Component changed from avcodec to avformat
  • Keywords mxf added; pixel format 10 bit removed
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

Is it possible that you made the sample so small that it is undecodable? I ask because the console output looks different here. Please confirm that you can decode the sample you uploaded with some software. There is no size limit for the ftp server.

For future tickets please remember to always test current FFmpeg git head and only to provide FFplay output for issues not reproducible with ffmpeg.

The issue is apparently only related to mxf demuxing, I have attached the first video frame which decodes fine with current FFmpeg.

$ ffmpeg -i j2ktest.mxf
ffmpeg version N-78974-g8ca2c87 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 28.100 / 57. 28.100
  libavformat    57. 28.100 / 57. 28.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 39.102 /  6. 39.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mxf @ 0x402e280] broken or empty index
[mxf @ 0x402e280] error getting stream index 352388352
    Last message repeated 22 times
[mxf @ 0x402e280] Could not find codec parameters for stream 0 (Video: jpeg2000, none, 1920x1088): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for  Input Stream #0.1 : mono
Guessed Channel Layout for  Input Stream #0.2 : mono
Guessed Channel Layout for  Input Stream #0.3 : mono
Guessed Channel Layout for  Input Stream #0.4 : mono
Guessed Channel Layout for  Input Stream #0.5 : mono
Guessed Channel Layout for  Input Stream #0.6 : mono
Guessed Channel Layout for  Input Stream #0.7 : mono
Guessed Channel Layout for  Input Stream #0.8 : mono
Input #0, mxf, from 'j2ktest.mxf':
  Metadata:
    uid             : ed2c62ee-9c6d-4b2f-bc4b-acd9c2a1d0eb
    company_name    : Evertz
    product_name    : MediaClient
    product_version : 1.1.[DEV BUILD] [RELEASE]-k
    product_uid     : dea52e0a-d0e4-11e1-9944-001b21566584
    modification_date: 2014-02-25 18:21:22
    generation_uid  : 272e1e74-3349-4283-8ec6-cd14113593fb
    material_package_umid: 0x060A2B340101010501010D431300000055DECFB39C874D64B533C4E3EB88F3A1
    material_package_name: Material Package
    timecode        : 00:00:00;00
  Duration: 00:00:59.89, start: 0.000000, bitrate: 1367 kb/s
    Stream #0:0: Video: jpeg2000, none, 1920x1088, SAR 136:135 DAR 16:9, 29.97 tbr, 29.97 tbn, 29.97 tbc
    Metadata:
      file_package_umid: 0x060A2B340101010501010D43130000006EE37E14F008423787AEE3C8D74AA7C5
      file_package_name: File Package
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D43130000006EE37E14F008423787AEE3C8D74AA7C5
      file_package_name: File Package
    Stream #0:2: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D43130000006EE37E14F008423787AEE3C8D74AA7C5
      file_package_name: File Package
    Stream #0:3: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D43130000006EE37E14F008423787AEE3C8D74AA7C5
      file_package_name: File Package
    Stream #0:4: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D43130000006EE37E14F008423787AEE3C8D74AA7C5
      file_package_name: File Package
    Stream #0:5: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D43130000006EE37E14F008423787AEE3C8D74AA7C5
      file_package_name: File Package
    Stream #0:6: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D43130000006EE37E14F008423787AEE3C8D74AA7C5
      file_package_name: File Package
    Stream #0:7: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D43130000006EE37E14F008423787AEE3C8D74AA7C5
      file_package_name: File Package
    Stream #0:8: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D43130000006EE37E14F008423787AEE3C8D74AA7C5
      file_package_name: File Package
At least one output file must be specified

comment:3 Changed 3 years ago by gemil

sample plays fine with mainconcept decoder

comment:4 Changed 3 years ago by gemil

  • Priority changed from normal to important

comment:5 Changed 3 years ago by cehoyos

  • Priority changed from important to normal

Please do not randomly change the ticket priority.

comment:6 Changed 3 years ago by gemil

It is critical to me in order to replace MainConcept? decoders

comment:7 Changed 3 years ago by cehoyos

How was the file created? I sent a patch but the developers who work with mxf seem to agree that the file is simply invalid.

comment:8 follow-up: Changed 3 years ago by gemil

I uploaded j2ktest.j2m file which is j2k video stream only stripped from j2ktest.mxf file.
Note: I cannot play that file either.

comment:9 in reply to: ↑ 8 Changed 3 years ago by cehoyos

Replying to gemil:

I uploaded j2ktest.j2m file which is j2k video stream only stripped from j2ktest.mxf file.

I already attached the first frame to this ticket, FFmpeg decodes it correctly.

The issue is that FFmpeg cannot extract this video stream from the mxf file you provided. FFmpeg developers believe that the reason is an invalid mxf file. Please explain what created the file.

comment:10 follow-up: Changed 3 years ago by gemil

It looks like the first picture can be decoded, but something at the end of it makes the next picture and subsequent ones undecodable.

comment:11 in reply to: ↑ 10 Changed 3 years ago by cehoyos

Replying to gemil:

It looks like the first picture can be decoded, but something at the end of it makes the next picture and subsequent ones undecodable.

The file format of the concatenated j2m file you uploaded is invalid and does not conform to any specification (to the best of my knowledge), Motion JPEG 2000 is defined as j2k in mov and (as far as decoding is concerned) supported by FFmpeg. I created ticket #5359 to allow decoding of such invalid files but this is completely unrelated to this ticket: Please explain what created the mxf file you uploaded. (Please do only explain it if you are interested in fixing your issue, if you are not interested in fixing it, do not explain anything.)

comment:12 follow-up: Changed 3 years ago by gemil

I created the mxf file with mxflib-1.0.1.
The library had no jpeg provision so I added the necessary functions to address this issue.

comment:13 in reply to: ↑ 12 Changed 3 years ago by cehoyos

Replying to gemil:

I created the mxf file with mxflib-1.0.1.
The library had no jpeg provision so I added the necessary functions to address this issue.

How can I reproduce this?
I would expect mxflib not to write files with different track numbers for header and stream.

comment:14 Changed 3 years ago by gemil

I corrected my mxf errors and I uploaded testj2k2.mxf file.
I had j2k track not referenced properly from metadata.
Now it is playing a few frames!

comment:15 Changed 3 years ago by gemil

I corrected my mxf errors and I uploaded testj2k2.mxf file.
I had j2k track not referenced properly from metadata.
Now it is playing a few frames!

comment:16 Changed 3 years ago by richardpl

Still looks like invalid file to me. Psot is too big.

comment:17 Changed 3 years ago by cehoyos

Which frame of the original file is not decoded correctly by FFmpeg?

comment:18 Changed 3 years ago by Tjoppen

Seems I was right about an incorrect encoder having written the file in this ticket. Please use something like the IRF MXF analyzer when writing MXF muxers (or using mxflib) to make sure you're doing things correctly. I will not maintain hacks in mxfdec to handle such incorrect usage.

Since this ticket is due to user error it should probably be closed. But I'll hold off on it for a few weeks.

comment:19 Changed 3 years ago by cehoyos

  • Resolution set to invalid
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.