Opened 9 years ago

Closed 9 years ago

#4328 closed defect (invalid)

FFplay and FFmpeg reproducing erroneous frames from JPEG2000 MXF OP1a files

Reported by: Morgan O Morel Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: mxf libopenjpeg
Cc: Michael Niedermayer Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

The problem occurs with the input file is a JPEG200 MXF OP1a file.

When creating H.264 MP4 with FFmpeg, or viewing the file with FFplay there are erroneous frames that appear in the output. The error typically appears as a magenta wash all over the top-right, bottom-left, and bottom-right quadrant of the frame.

The error frame does not appear in the MXF when viewing it in any other software.

When viewing the MP4 in Dave Rice's QCTools (version 0.7.0) the MP4 appears to have a spike in the V channel.

How to reproduce:

Last login: Tue Feb 24 15:41:21 on console
ffplay -vcodec libopenjpeg -i input.mxf -vf tinterlace=mode=merge,yadif=1
You have mail.
Transfer17:~ transfer17$ ffplay -vcodec libopenjpeg -i '/Volumes/GBAUDIO/Video/Projects/2013374 CUGSJ/Production/dupont_2003_2004_9_TV/Master/dupont_2003_2004_9_TV_03_m.mxf' -vf tinterlace=mode=merge,yadif=1
ffplay version 2.4.2 Copyright (c) 2003-2014 the FFmpeg developers
  built on Oct  7 2014 09:18:52 with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.4.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=gcc-4.2 --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libopus --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 '
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
[mxf @ 0x103002000] could not resolve sub descriptor strong ref/0   
[mxf @ 0x103002000] source track 4: stream 2, no descriptor found
Input #0, mxf, from '/Volumes/GBAUDIO/Video/Projects/2013374 CUGSJ/Production/dupont_2003_2004_9_TV/Master/dupont_2003_2004_9_TV_03_m.mxf':
  Metadata:
    application_platform: Linux 2.6.32-279.el6.x86_64 x86_64
    uid             : ff8e22f4-b47e-11e4-92c5-00259001dc61
    generation_uid  : ff8e22f4-b47e-11e4-92c6-00259001dc61
    company_name    : OpenCube
    product_name    : MXFTk Advanced
    product_uid     : 109c5440-d21d-b211-8029-001111ebc476
    product_version : 2.6.4.20140909
    modification_date: 2015-02-14 14:44:17
    timecode        : 00:00:00:00
  Duration: 00:30:38.84, start: 0.000000, bitrate: 105626 kb/s
    Stream #0:0: Video: jpeg2000, yuv422p10le, 720x243, 59.94 tbr, 59.94 tbn, 59.94 tbc
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 4 channels, s32 (24 bit), 4608 kb/s
    Stream #0:2: Data: none

or

% ffmpeg -vsync 0 -i input.mxf -vcodec libx264 -s 640x480 -aspect 4:3 -pix_fmt yuv420p -profile:v main -b:v 3000000 -vf tinterlace=mode=merge,yadif=1,crop=720:480:0:4 -r 30000/1001 -coder 0 -acodec libfaac -b:a 192000 -sample_fmt s16 -ar 48000 -ac 2 -y output.mp4
ffmpeg version 2.4.2
built on Oct  7 2014 09:05:26 with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.4.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=gcc-4.2 --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libopus --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 '
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
[mxf @ 0x10200f200] could not resolve sub descriptor strong ref
[mxf @ 0x10200f200] source track 4: stream 2, no descriptor found
Guessed Channel Layout for  Input Stream #0.1 : 4.0
Input #0, mxf, from '/Volumes/GBAUDIO/Video/Projects/2013374 CUGSJ/Production/dupont_2003_2004_9_TV/Master/dupont_2003_2004_9_TV_01_m.mxf':
  Metadata:
    application_platform: Linux 2.6.32-279.el6.x86_64 x86_64
    uid             : bfd3165a-b470-11e4-8d3e-0025906211e5
    generation_uid  : bfd3166e-b470-11e4-8d3e-0025906211e5
    company_name    : OpenCube
    product_name    : MXFTk Advanced
    product_uid     : 109c5440-d21d-b211-8029-001111ebc476
    product_version : 2.6.4.20140909
    modification_date: 2015-02-14 13:00:59
    timecode        : 00:00:00:00
  Duration: 01:07:05.69, start: 0.000000, bitrate: 101370 kb/s
    Stream #0:0: Video: jpeg2000, yuv422p10le, 720x243, 59.94 tbr, 59.94 tbn, 59.94 tbc
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 4 channels, s32 (24 bit), 4608 kb/s
    Stream #0:2: Data: none
[libx264 @ 0x10219c000] using SAR=1/1
[libx264 @ 0x10219c000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x10219c000] profile Main, level 3.0
[libx264 @ 0x10219c000] 264 - core 142 r2479 dd79a61 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=3000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/Volumes/GBAUDIO/Video/Projects/2013374 CUGSJ/Production/dupont_2003_2004_9_TV/Access/dupont_2003_2004_9_TV_01_s.mp4':
  Metadata:
    application_platform: Linux 2.6.32-279.el6.x86_64 x86_64
    uid             : bfd3165a-b470-11e4-8d3e-0025906211e5
    generation_uid  : bfd3166e-b470-11e4-8d3e-0025906211e5
    company_name    : OpenCube
    product_name    : MXFTk Advanced
    product_uid     : 109c5440-d21d-b211-8029-001111ebc476
    product_version : 2.6.4.20140909
    modification_date: 2015-02-14 13:00:59
    timecode        : 00:00:00:00
    encoder         : Lavf56.4.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 3000 kb/s, 29.97 fps, 30k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc56.1.100 libx264
    Stream #0:1: Audio: aac (libfaac) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16 (24 bit), 192 kb/s
    Metadata:
      encoder         : Lavc56.1.100 libfaac
Stream mapping:
  Stream #0:0 -> #0:0 (jpeg2000 (libopenjpeg) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_s24le (native) -> aac (libfaac))

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (8)

comment:1 by Michael Niedermayer, 9 years ago

Where can the not working input file be found ?

comment:2 by Michael Niedermayer, 9 years ago

Cc: Michael Niedermayer added

comment:3 by Carl Eugen Hoyos, 9 years ago

Keywords: j2k added; jpeg2000 libopenjpeg libx264 removed

comment:4 by Morgan O Morel, 9 years ago

An MXF/J2K file that causes the problem can be downloaded here:

http://georgeblood.com/Library/01_Bad_Frame_2.24.mxf
http://georgeblood.com/Library/01_Bad_Frame_2.24.mxf.md5

The bad frame is at 2:24

in reply to:  4 ; comment:5 by Carl Eugen Hoyos, 9 years ago

Replying to iamdamosuzuki:

An MXF/J2K file that causes the problem can be downloaded here:

http://georgeblood.com/Library/01_Bad_Frame_2.24.mxf
http://georgeblood.com/Library/01_Bad_Frame_2.24.mxf.md5

The bad frame is at 2:24

The file you uploaded is 11.5 seconds long, how can the issue be reproduced with this file?

in reply to:  5 comment:6 by Morgan O Morel, 9 years ago

Replying to cehoyos:

Replying to iamdamosuzuki:

An MXF/J2K file that causes the problem can be downloaded here:

http://georgeblood.com/Library/01_Bad_Frame_2.24.mxf
http://georgeblood.com/Library/01_Bad_Frame_2.24.mxf.md5

The bad frame is at 2:24

The file you uploaded is 11.5 seconds long, how can the issue be reproduced with this file?

If the file is played back using ffplay a bad frame is present at 2:24

ffplay -vcodec libopenjpeg -i 01_Bad_Frame_2.24.mxf -vf tinterlace=mode=merge,yadif=1

However, it has been discovered that the issue is with libopenjpeg and not ffmpeg.

comment:7 by Morgan O Morel, 9 years ago

It has been discovered that the issue is with libopenjpeg and not FFmpeg.

openjpeg 1.5.1 has the bug. Building FFmpeg with openjpeg 1.5.0 fixes the issue.

comment:8 by Carl Eugen Hoyos, 9 years ago

Keywords: libopenjpeg added; j2k removed
Resolution: invalid
Status: newclosed

Thank you for testing!

Note: See TracTickets for help on using tickets.