Opened 12 years ago

Last modified 4 years ago

#1102 open defect

mxf separate fields in interlaced j2k

Reported by: Alex Zhukov Owned by: mateo
Priority: normal Component: avformat
Version: git-master Keywords: mxf j2k
Cc: dave@dericed.com, matthieu.bouron@gmail.com, kieran.o.leary@gmail.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

http://dl.dropbox.com/u/1109725/ntsc2.mxf
this mxf stores fields as two separate j2k images
expected dimension: 720x486
actual dimension: 720x243

Change History (15)

comment:1 by Carl Eugen Hoyos, 12 years ago

Keywords: mxf added

Please add a ffmpeg -i ntsc2.mxf output.

comment:2 by Carl Eugen Hoyos, 11 years ago

Keywords: j2k added
Status: newopen
$ ffmpeg -i ntsc2.mxf
ffmpeg version N-44896-ge4b1fcd Copyright (c) 2000-2012 the FFmpeg developers
  built on Sep 30 2012 14:35:48 with gcc 4.5.3 (GCC)
  configuration: --cc=/usr/local/gcc-4.5.3/bin/gcc --enable-gpl --enable-libopenjpeg
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 61.100 / 54. 61.100
  libavformat    54. 29.105 / 54. 29.105
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 18.100 /  3. 18.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[mxf @ 0x150a240] broken or empty index
Input #0, mxf, from 'ntsc2.mxf':
  Metadata:
    timecode        : 02:57:45;02
  Duration: 00:00:01.53, start: 0.000000, bitrate: 78647 kb/s
    Stream #0:0: Video: jpeg2000, yuv422p10le, 720x243, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
At least one output file must be specified

comment:3 by Carl Eugen Hoyos, 11 years ago

This sample may be related:
http://samples.ffmpeg.org/jpeg2000/jpeg2000_mxf_first_10mb.mxf

$ ffmpeg -i jpeg2000_mxf_first_10mb.mxf
ffmpeg version N-52668-gf685aee Copyright (c) 2000-2013 the FFmpeg developers
  built on May  3 2013 07:42:11 with gcc 4.7 (SUSE Linux)
  configuration: --enable-libopenjpeg --enable-gpl --disable-indev=jack
  libavutil      52. 27.101 / 52. 27.101
  libavcodec     55.  6.100 / 55.  6.100
  libavformat    55.  4.100 / 55.  4.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 62.100 /  3. 62.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[mxf @ 0x1e35000] broken or empty index
[mxf @ 0x1e35000] error getting stream index 67174400
[jpeg2000 @ 0x1e38440] SOD marker not found
[jpeg2000 @ 0x1e38440] error during processing marker segment ff90
[mxf @ 0x1e35000] error getting stream index 67174400
    Last message repeated 40 times
[mxf @ 0x1e35000] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for  Input Stream #0.1 : 4.0
Input #0, mxf, from 'jpeg2000_mxf_first_10mb.mxf':
  Metadata:
    uid             : 81ddd167-c3b8-11de-a525-001b2128a1f2
    generation_uid  : 81ddd168-c3b8-11de-a2e4-001b2128a1f2
    company_name    : SAMMA Systems
    product_name    : MXF for SAMMA mjpeg2k
    product_version : 0.2.0.41
    application_platform: win32
    product_uid     : 43339ae6-9040-4e2c-be5f-a3de38328894
    modification_date: 2009-10-28 11:53:28
    timecode        : 01:03:34:21
  Duration: 00:00:26.67, start: 0.000000, bitrate: 3071 kb/s
    Stream #0:0: Video: jpeg2000 (JPEG 2000 codestream restriction 0), rgb24, 720x243, 59.94 fps, 59.94 tbr, 59.94 tbn, 59.94 tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, 4.0, s16, 3072 kb/s
At least one output file must be specified

comment:4 by Carl Eugen Hoyos, 11 years ago

Last edited 4 years ago by Carl Eugen Hoyos (previous) (diff)

comment:5 by dave rice, 9 years ago

MXF/j2k with this type of interlacement seem to be gaining popularity, so I wanted to bump this ticket. I have a variety of interlaced mxf/j2k if the patch requires more testing.

comment:6 by dave rice, 9 years ago

Cc: dave@dericed.com added

comment:7 by mateo, 9 years ago

Analyzed by developer: set
Cc: matthieu.bouron@gmail.com added
Owner: set to mateo
Reproduced by developer: set

I'm currently working on this issue. New patches should be expected within a couple of days.

Last edited 9 years ago by mateo (previous) (diff)

comment:8 by Carl Eugen Hoyos, 9 years ago

I hope this will work with the native jpeg2000 decoder...

in reply to:  8 comment:9 by mateo, 9 years ago

Replying to cehoyos:

I hope this will work with the native jpeg2000 decoder...

As long as the decoder is able to decode the stream, it will work with it.

Last edited 9 years ago by mateo (previous) (diff)

comment:10 by Thijs Leegwater, 8 years ago

Would it be hard to patch mxfenc as well, so it will be possible to generate field-wrapped j2k mxf through ffmpeg?
If I want to give it a shot myself, which parts need attention?

I can come up with changing the frame layout tag to "2" (Separate Fields), but there's more to it to make this work

     // frame layout
    mxf_write_local_tag(pb, 1, 0x320C);
    avio_w8(pb, 2);
Last edited 8 years ago by Thijs Leegwater (previous) (diff)

comment:11 by Carl Eugen Hoyos, 8 years ago

I believe that the following sample has the same issue:
http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket2817/warehouse.mxf

comment:13 by kieranjol, 6 years ago

Cc: kieran.o.leary@gmail.com added

I just noticed this with a jpeg2000/MXF PAL 50i capture using Avid Media Composer. 720x592 showed up as 720x296 in ffmpeg.

comment:14 by kieranjol, 4 years ago

Hi, another user just reported this issue to me. I checked with git master and the initial sample - short.mxf - appears to decode correctly in both ffmpeg and vlc, but jpeg2000_mxf_first_10mb is still showing half height. I also decoded with libopenjpeg but only on ffmpeg 4.1.1 and that also shows half height.

./ffmpeg -i /Users/bla/Downloads/jpeg2000_mxf_first_10mb.mxf 
ffmpeg version N-94982-gea673a0edb Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: 
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 58.101 / 58. 58.101
  libavformat    58. 32.104 / 58. 32.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
[mxf @ 0x7fc0c2009000] broken or empty index
[mxf @ 0x7fc0c2009000] error getting stream index 67174400
[jpeg2000 @ 0x7fc0c2803200] unsupported marker 0xFF61 at pos 0x62
[jpeg2000 @ 0x7fc0c2803200] Invalid len 0 left=0
[mxf @ 0x7fc0c2009000] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for Input Stream #0.1 : 4.0
Input #0, mxf, from '/Users/bla/Downloads/jpeg2000_mxf_first_10mb.mxf':
  Metadata:
    operational_pattern_ul: 060e2b34.04010101.0d010201.01010900
    uid             : 81ddd167-c3b8-11de-a525-001b2128a1f2
    generation_uid  : 81ddd168-c3b8-11de-a2e4-001b2128a1f2
    company_name    : SAMMA Systems
    product_name    : MXF for SAMMA mjpeg2k
    product_version : 0.2.0.41
    application_platform: win32
    product_uid     : 43339ae6-9040-4e2c-be5f-a3de38328894
    modification_date: 2009-10-28T11:53:28.788000Z
    material_package_umid: 0x060A2B340101010501010D121322F4CC034B8D0232510585CFD3001B2128A1F2
    timecode        : 01:03:34:21
  Duration: 00:00:26.65, start: 0.000000, bitrate: 3073 kb/s
    Stream #0:0: Video: jpeg2000, yuv422p(top first), 720x243, lossless, SAR 9:20 DAR 4:3, 59.94 tbr, 59.94 tbn, 59.94 tbc
    Metadata:
      file_package_umid: 0x060A2B340101010501010D121349F1F1034B8D0232510585BBE9001B2128A1F2
      file_package_name: Source Package
      track_name      : Track 1
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, 4.0, s16, 3072 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D121349F1F1034B8D0232510585BBE9001B2128A1F2
      file_package_name: Source Package
      track_name      : Track 2

in reply to:  14 comment:15 by Carl Eugen Hoyos, 4 years ago

Replying to kieranjol:

I checked with git master and the initial sample - short.mxf - appears to decode correctly in both ffmpeg

I have removed this sample as it seems unrelated to this ticket (that is only reproducible with jpeg2000 and hevc while the sample contained mpeg2video).

Note: See TracTickets for help on using tickets.