Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#3916 closed enhancement (fixed)

Unable to decode ImageJ AVI with PNG compression

Reported by: Chris Allan Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: avi png
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug: FFmpeg (via ffprobe) is unable to display stream metadata for PNG compressed AVIs created by ImageJ (http://imagej.nih.gov/ij/). ffplay is also not able to play the AVI. It is playable using QuickTime X or QuickTime 7 on Mac OS X and QuickTime 7 on Windows 7 but not out of the box using Windows Media Player 12 on Windows 7. VLC also plays the AVI correctly.

Full encoder source is available here:

Attaching the entire 285836 byte file for analysis.

How to reproduce:

$ ffprobe -show_streams -v 9 -loglevel 99 avi_with_png_compression.avi 
ffprobe version N-66035-g4cabee5 Copyright (c) 2007-2014 the FFmpeg developers
  built on Sep  2 2014 09:12:04 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --prefix=/Users/callan/app/ffmpeg --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libtheora --enable-libvorbis --enable-libvpx --enable-ffplay
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  3.100 / 56.  3.100
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  0.103 /  5.  0.103
  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
[avi @ 0x7fbfd181e600] Format avi probed with size=2048 and score=100
[avi @ 0x7fbfd1413440] use odml:1
[avi @ 0x7fbfd181e600] Before avformat_find_stream_info() pos: 4108 bytes read:108136 seeks:4
[avi @ 0x7fbfd181e600] parser not found for codec none, packets or times may be invalid.
    Last message repeated 1 times
[avi @ 0x7fbfd181e600] max_analyze_duration 5000000 reached at 5000000 microseconds
[avi @ 0x7fbfd181e600] Could not find codec parameters for stream 0 (Video: none (png  / 0x20676E70), 30x26, 1/30, 215 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[avi @ 0x7fbfd181e600] After avformat_find_stream_info() pos: 141733 bytes read:239208 seeks:4 frames:150
avi_with_png_compression.avi: Operation not permitted
$ ffmpeg -v 9 -loglevel 99 -i avi_with_png_compression.avi 
ffmpeg version N-66035-g4cabee5 Copyright (c) 2000-2014 the FFmpeg developers
  built on Sep  2 2014 09:12:04 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --prefix=/Users/callan/app/ffmpeg --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libtheora --enable-libvorbis --enable-libvpx --enable-ffplay
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  3.100 / 56.  3.100
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  0.103 /  5.  0.103
  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
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-i' ... matched as input file with argument 'avi_with_png_compression.avi'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input file avi_with_png_compression.avi.
Successfully parsed a group of options.
Opening an input file: avi_with_png_compression.avi.
[avi @ 0x7f85ab023400] Format avi probed with size=2048 and score=100
[avi @ 0x7f85aac13ca0] use odml:1
[avi @ 0x7f85ab023400] Before avformat_find_stream_info() pos: 4108 bytes read:108136 seeks:4
[avi @ 0x7f85ab023400] parser not found for codec none, packets or times may be invalid.
    Last message repeated 1 times
[avi @ 0x7f85ab023400] max_analyze_duration 5000000 reached at 5000000 microseconds
[avi @ 0x7f85ab023400] Could not find codec parameters for stream 0 (Video: none (png  / 0x20676E70), 30x26, 1/30, 215 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[avi @ 0x7f85ab023400] After avformat_find_stream_info() pos: 141733 bytes read:239208 seeks:4 frames:150
avi_with_png_compression.avi: could not find codec parameters
Input #0, avi, from 'avi_with_png_compression.avi':
  Duration: 00:00:10.23, start: 0.000000, bitrate: 223 kb/s
    Stream #0:0, 150, 1/30: Video: none (png  / 0x20676E70), 30x26, 1/30, 215 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
    Metadata:
      title           : ImageJ AVI     
Successfully opened the file.
At least one output file must be specified
[AVIOContext @ 0x7f85aac13be0] Statistics: 239208 bytes read, 4 seeks
$ ffmpeg -version
ffmpeg version N-66035-g4cabee5 Copyright (c) 2000-2014 the FFmpeg developers
built on Sep  2 2014 09:12:04 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
configuration: --prefix=/Users/callan/app/ffmpeg --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libtheora --enable-libvorbis --enable-libvpx --enable-ffplay
libavutil      54.  7.100 / 54.  7.100
libavcodec     56.  1.100 / 56.  1.100
libavformat    56.  3.100 / 56.  3.100
libavdevice    56.  0.100 / 56.  0.100
libavfilter     5.  0.103 /  5.  0.103
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

Attachments (1)

avi_with_png_compression.avi (279.1 KB ) - added by Chris Allan 10 years ago.
AVI with PNG compression created with ImageJ

Download all attachments as: .zip

Change History (3)

by Chris Allan, 10 years ago

AVI with PNG compression created with ImageJ

comment:1 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavformat
Keywords: avi png added
Priority: normalwish
Reproduced by developer: set
Resolution: fixed
Status: newclosed
Summary: Unable to display stream metadata for AVI with PNG compressionUnable to decode ImageJ AVI with PNG compression
Type: defectenhancement

Should be fixed in 3668168a - thank you for the sample!

comment:2 by Chris Allan, 10 years ago

Thanks for the quick fix! Confirmed working in 3668168a:

$ ffprobe -show_streams -print_format json avi_with_png_compression.avi 
ffprobe version N-66039-g3668168 Copyright (c) 2007-2014 the FFmpeg developers
  built on Sep  2 2014 11:19:26 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --prefix=/Users/callan/app/ffmpeg --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libtheora --enable-libvorbis --enable-libvpx --enable-ffplay
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  3.100 / 56.  3.100
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  0.103 /  5.  0.103
  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
{
Input #0, avi, from 'avi_with_png_compression.avi':
  Duration: 00:00:10.23, start: 0.000000, bitrate: 223 kb/s
    Stream #0:0: Video: png (png  / 0x20676E70), rgb24, 30x26, 215 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
    Metadata:
      title           : ImageJ AVI     
    "streams": [
        {
            "index": 0,
            "codec_name": "png",
            "codec_long_name": "PNG (Portable Network Graphics) image",
            "codec_type": "video",
            "codec_time_base": "1/30",
            "codec_tag_string": "png ",
            "codec_tag": "0x20676e70",
            "width": 30,
            "height": 26,
            "has_b_frames": 0,
            "sample_aspect_ratio": "0:1",
            "display_aspect_ratio": "0:1",
            "pix_fmt": "rgb24",
            "level": -99,
            "r_frame_rate": "30/1",
            "avg_frame_rate": "30/1",
            "time_base": "1/30",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 307,
            "duration": "10.233333",
            "bit_rate": "215059",
            "nb_frames": "307",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0
            },
            "tags": {
                "title": "ImageJ AVI     "
            }
        }
    ]
}
Note: See TracTickets for help on using tickets.