Opened 5 years ago

Closed 5 years ago

#263 closed defect (fixed)

Unimplemented container channel layout

Reported by: rectalogic Owned by: cehoyos
Priority: normal Component: avformat
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Sample mov with svq1 video and qdm2 audio used to play both audio and video with ffplay (using commit f1efbca5e), now it plays a single frame of video and no audio and logs "Unimplemented container channel layout". This also has the side effect of causing mplayer to crash.

I'll try attaching the sample to this bug, upload.ffmpeg.org seems to be down.

$ ./ffplay ~/Projects/codex/passport-bugs/qdm2/qdm2-channels.mov
ffplay version git-N-30462-gd013c6d, Copyright (c) 2003-2011 the FFmpeg developers
  built on Jun  3 2011 18:05:38 with gcc 4.4.3
  configuration:
  libavutil    51.  3. 0 / 51.  3. 0
  libavcodec   53.  6. 1 / 53.  6. 1
  libavformat  53.  2. 0 / 53.  2. 0
  libavdevice  53.  1. 0 / 53.  1. 0
  libavfilter   2. 11. 0 /  2. 11. 0
  libswscale    0. 14. 0 /  0. 14. 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x16a0660] Unimplemented container channel layout.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x16a0660] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x16a0660] max_analyze_duration 5000000 reached at 5120000
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/aw/Projects/codex/passport-bugs/qdm2/qdm2-channels.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2006-11-03 19:12:00
    composer        : This movie was made with Adobe GoLive.
    composer-eng    : This movie was made with Adobe GoLive.
  Duration: 00:00:30.03, start: 0.000000, bitrate: 311 kb/s
    Stream #0.0(eng): Audio: qdm2, 32000 Hz, 1 channels, s16, 24 kb/s
    Metadata:
      creation_time   : 2006-11-03 19:12:00
    Stream #0.1(eng): Video: svq1, yuv410p, 320x240, 285 kb/s, 14.99 fps, 14.99 tbr, 15k tbn, 15k tbc
    Metadata:
      creation_time   : 2006-11-03 19:12:00
    Stream #0.2(eng): Data: [0][0][0][0] / 0x0000, 0 kb/s
    Metadata:
      creation_time   : 2006-11-03 19:12:00
[ffsink @ 0x7f94d8000d60] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x7f94d8001440] w:320 h:240 fmt:yuv410p -> w:320 h:240 fmt:yuv420p flags:0x4

Attachments (2)

qdm2-channels.mov (1.1 MB) - added by rectalogic 5 years ago.
sample video
chan.diff (1.3 KB) - added by rectalogic 5 years ago.
patch to handle other 'chan' atom sizes

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by rectalogic

sample video

comment:1 follow-up: Changed 5 years ago by cehoyos

  • Owner set to cehoyos
  • Status changed from new to open

Thank you for the sample!

Since I cannot reproduce a crash with mplayer, and ffplay plays your sample fine for me, could you either provide a backtrace for the MPlayer crash or more information for the problem with ffplay? Does converting the file with ffmpeg -i qdm2-channels.mov out.avi produce a working file for you?

comment:2 in reply to: ↑ 1 Changed 5 years ago by rectalogic

Replying to cehoyos:

Since I cannot reproduce a crash with mplayer, and ffplay plays your sample fine for me, could you either provide a backtrace for the MPlayer crash or more information for the problem with ffplay? Does converting the file with ffmpeg -i qdm2-channels.mov out.avi produce a working file for you?

Converting with ffmpeg still prints the warning, but does result in a working file (audio and video).

mplayer compiled 64bit does not crash. 32bit mplayer crashes with this backtrace:

libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x8f11500] Unimplemented container channel layout.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x8f11500] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x8f11500] max_analyze_duration 5000000 reached at 5120000
[lavf] stream 0: audio (qdm2), -aid 0, -alang eng
[lavf] stream 1: video (svq1), -vid 0
VIDEO:  [SVQ1]  320x240  24bpp  14.985 fps  285.6 kbps (34.9 kbyte/s)
Clip info:
 major_brand: qt
 minor_version: 537199360
 compatible_brands: qt
 creation_time: 2006-11-03 19:12:00
 composer: This movie was made with Adobe GoLive.
 composer-eng: This movie was made with Adobe GoLive.
Load subtitles in /storage/dataset/
[gl] no GLX support present
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffsvq1] vfm: ffmpeg (FFmpeg Sorenson Video v1 (SVQ1))
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders

Program received signal SIGSEGV, Segmentation fault.
0x085d1140 in apply_window_mp3 (in=0x8f94900, win=0x8e73a20,
    unused=0xffffb25c, out=0xffff8e5c, incr=1) at x86/mpegaudiodec_mmx.c:120
120             __asm__ volatile(
(gdb) bt
#0  0x085d1140 in apply_window_mp3 (in=0x8f94900, win=0x8e73a20,
    unused=0xffffb25c, out=0xffff8e5c, incr=1) at x86/mpegaudiodec_mmx.c:120
#1  0x08481085 in ff_mpa_synth_filter_float (s=0x8f948e8,
    synth_buf_ptr=0x8f94900, synth_buf_offset=0x8f96900, window=0x8e73a20,
    dither_state=0xffffb25c, samples=0xffff8e5c, incr=1, sb_samples=0x8f96920)
    at mpegaudiodsp_template.c:173
#2  0x084c43de in qdm2_synthesis_filter (q=<value optimized out>,
    index=<value optimized out>) at qdm2.c:1616
#3  0x084c6f84 in qdm2_decode (avctx=0x8f37cc0, data=0xf6bd5020,
    data_size=0xffffb468, avpkt=0xffffb414) at qdm2.c:1927
#4  qdm2_decode_frame (avctx=0x8f37cc0, data=0xf6bd5020, data_size=0xffffb468,
    avpkt=0xffffb414) at qdm2.c:1966
#5  0x08522740 in avcodec_decode_audio3 (avctx=0x8f37cc0, samples=0xf6bd5020,
    frame_size_ptr=0xffff8e5c, avpkt=0xffffb414) at utils.c:796
#6  0x081efc38 in decode_audio (sh_audio=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at libmpcodecs/ad_ffmpeg.c:229
#7  0x081f00cf in init (sh_audio=0x8f182e0) at libmpcodecs/ad_ffmpeg.c:159
#8  0x0814424d in init_audio_codec (sh_audio=0x8f182e0,
    codecname=<value optimized out>, afm=<value optimized out>, status=1,
    selected=0xffffb59c) at libmpcodecs/dec_audio.c:107
#9  init_audio (sh_audio=0x8f182e0, codecname=<value optimized out>,
    afm=<value optimized out>, status=1, selected=0xffffb59c)
    at libmpcodecs/dec_audio.c:229
#10 0x0814463d in init_best_audio_codec (sh_audio=0x8f182e0,
---Type <return> to continue, or q <return> to quit---
    audio_codec_list=0xffffb594, audio_fm_list=0x0)
    at libmpcodecs/dec_audio.c:282
#11 0x080cbd1d in reinit_audio_chain () at mplayer.c:1713
#12 0x080ce86e in main (argc=2, argv=0xffffd794) at mplayer.c:3688

I also ran "ffmpeg -i qdm2-channels.mov " under gdb and set a breakpoint in ff_mov_read_chan() which is where the warning is being printed - it is warning because size is 32 and it expects it to be 12. If you set a breakpoint here do you see the same thing? Analyzing the file itself, the 'chan' tag is 32 bytes so I would expect the warning.

#0  ff_mov_read_chan (s=0x130d3e0, size=32, codec=0x1310120)
    at libavformat/isom.c:462
462         if (size != 12) {
(gdb) p size
$6 = 32
(gdb) bt
#0  ff_mov_read_chan (s=0x130d3e0, size=32, codec=0x1310120)
    at libavformat/isom.c:462
#1  0x0000000000490e5b in mov_read_chan (c=0x130da00,
    pb=<value optimized out>, atom=...) at libavformat/mov.c:2213
#2  0x0000000000490c16 in mov_read_default (c=0x130da00, pb=0x1315a60,
    atom=...) at libavformat/mov.c:308
#3  0x0000000000496030 in ff_mov_read_stsd_entries (c=<value optimized out>,
    pb=0x1315a60, entries=<value optimized out>) at libavformat/mov.c:1190
#4  0x0000000000490c16 in mov_read_default (c=0x130da00, pb=0x1315a60,
    atom=...) at libavformat/mov.c:308
#5  0x0000000000490c16 in mov_read_default (c=0x130da00, pb=0x1315a60,
    atom=...) at libavformat/mov.c:308
#6  0x0000000000490c16 in mov_read_default (c=0x130da00, pb=0x1315a60,
    atom=...) at libavformat/mov.c:308
#7  0x0000000000490c16 in mov_read_default (c=0x130da00, pb=0x1315a60,
    atom=...) at libavformat/mov.c:308
#8  0x00000000004942a7 in mov_read_trak (c=0x130da00, pb=0x1315a60, atom=...)
    at libavformat/mov.c:1752
#9  0x0000000000490c16 in mov_read_default (c=0x130da00, pb=0x1315a60,
    atom=...) at libavformat/mov.c:308
#10 0x0000000000490cd5 in mov_read_moov (c=0x130d3e0, pb=0x20, atom=...)
    at libavformat/mov.c:585
#11 0x0000000000490c16 in mov_read_default (c=0x130da00, pb=0x1315a60,
---Type <return> to continue, or q <return> to quit---
    atom=...) at libavformat/mov.c:308
#12 0x0000000000494f00 in mov_read_header (s=<value optimized out>,
    ap=<value optimized out>) at libavformat/mov.c:2397
#13 0x00000000004e3d33 in av_demuxer_open (ic=0x130d3e0, ap=0x20)
    at libavformat/utils.c:481
#14 0x000000000043548f in opt_input_file (opt=<value optimized out>,
    filename=0x7fffffffe3ce "/storage/dataset/MPEG-4++SVQ1-320x240++Qdesign_2--hreftrack-1200912-87d04a01f0c90814.mov") at ffmpeg.c:3289
#15 0x0000000000440121 in parse_options (argc=3, argv=0x7fffffffe148,
    options=<value optimized out>,
    parse_arg_function=0x43cd30 <opt_output_file>) at cmdutils.c:279
#16 0x000000000043ba9e in main (argc=3, argv=0x7fffffffe148) at ffmpeg.c:4524
(gdb) up
#1  0x0000000000490e5b in mov_read_chan (c=0x130da00,
    pb=<value optimized out>, atom=...) at libavformat/mov.c:2213
2213        ff_mov_read_chan(c->fc, atom.size - 4, c->fc->streams[0]->codec);
(gdb) p atom
$7 = {type = 1851877475, size = 36}

If you look at the channel layout tag field in the 'chan' atom in the sample, it's 0x640001. This is (100<<16)|1 which is kCAFChannelLayoutTag_Mono (I think Apples CAF docs define the channel layout flags)

So I think this 'chan' atom seems valid even though it is larger than ffmpeg expects - looking at the docs it seems like any size should be allowed - 'chan' atoms are variable sized and the only restriction is the size must be valid.

I'll attach a patch. Unfortunately, 32 bit mplayer still crashes even with the patch - that must be a different issue.

Changed 5 years ago by rectalogic

patch to handle other 'chan' atom sizes

comment:3 Changed 5 years ago by rectalogic

So I think my patch is OK, but that the crash is a different issue. 32bit ffplay also crashes playing this file (with or without the patch), and so does 32 bit "ffmpeg -i qdm2-channels.mov out.avi"

ffplay version git-N-30509-g49125ae, Copyright (c) 2003-2011 the FFmpeg developers
  built on Jun  7 2011 04:26:38 with gcc 4.4.3
  configuration: --enable-debug=gdb3
  libavutil    51.  4. 0 / 51.  4. 0
  libavcodec   53.  6. 1 / 53.  6. 1
  libavformat  53.  2. 0 / 53.  2. 0
  libavdevice  53.  1. 0 / 53.  1. 0
  libavfilter   2. 12. 0 /  2. 12. 0
  libswscale    0. 14. 1 /  0. 14. 1
[New Thread 0xf788ab70 (LWP 26047)]
[New Thread 0xf2df5b70 (LWP 26048)]
[Thread 0xf2df5b70 (LWP 26048) exited]
[New Thread 0xf2df5b70 (LWP 26049)]
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x8d77c80] max_analyze_duration 5000000 reached at 5120000
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/dataset/MPEG-4++SVQ1-320x240++Qdesign_2--hreftrack-1200912-87d04a01f0c90814.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2006-11-03 19:12:00
    composer        : This movie was made with Adobe GoLive.
    composer-eng    : This movie was made with Adobe GoLive.
  Duration: 00:00:30.03, start: 0.000000, bitrate: 311 kb/s
    Stream #0.0(eng): Audio: qdm2, 32000 Hz, mono, s16, 24 kb/s
    Metadata:
      creation_time   : 2006-11-03 19:12:00
    Stream #0.1(eng): Video: svq1, yuv410p, 320x240, 285 kb/s, 14.99 fps, 14.99 tbr, 15k tbn, 15k tbc
    Metadata:
      creation_time   : 2006-11-03 19:12:00
    Stream #0.2(eng): Data: [0][0][0][0] / 0x0000, 0 kb/s
    Metadata:
      creation_time   : 2006-11-03 19:12:00
[New Thread 0xf6d28b70 (LWP 26050)]
[New Thread 0xf6527b70 (LWP 26052)]
[New Thread 0xf5b26b70 (LWP 26053)]
[ffsink @ 0x8dddb60] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[New Thread 0xf5325b70 (LWP 26054)]
[scale @ 0x8e113a0] w:320 h:240 fmt:yuv410p -> w:320 h:240 fmt:yuv420p flags:0x4

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xf6527b70 (LWP 26052)]
0x08568374 in apply_window_mp3 (in=0x8daf780, win=0x8cb9320,
    unused=0xf652706c, out=0xf6524c6c, incr=1)
    at libavcodec/x86/mpegaudiodec_mmx.c:120
120             __asm__ volatile(
(gdb) bt
#0  0x08568374 in apply_window_mp3 (in=0x8daf780, win=0x8cb9320,
    unused=0xf652706c, out=0xf6524c6c, incr=1)
    at libavcodec/x86/mpegaudiodec_mmx.c:120
#1  0x083af19c in ff_mpa_synth_filter_float (s=0x8daf768,
    synth_buf_ptr=0x8daf780, synth_buf_offset=0x8db1780, window=0x8cb9320,
    dither_state=0xf652706c, samples=0xf6524c6c, incr=1, sb_samples=0x8db17a0)
    at libavcodec/mpegaudiodsp_template.c:173
#2  0x08404b48 in qdm2_synthesis_filter (q=0x8da3f40,
    index=<value optimized out>) at libavcodec/qdm2.c:1616
#3  0x08408255 in qdm2_decode (avctx=0x8d76040, data=0xf6d290c0,
    data_size=0xf65272cc, avpkt=0xf6db5acc) at libavcodec/qdm2.c:1927
#4  qdm2_decode_frame (avctx=0x8d76040, data=0xf6d290c0, data_size=0xf65272cc,
    avpkt=0xf6db5acc) at libavcodec/qdm2.c:1966
#5  0x08488ec0 in avcodec_decode_audio3 (avctx=0x8d76040, samples=0xf6d290c0,
    frame_size_ptr=0xf6524c6c, avpkt=0xf6db5acc) at libavcodec/utils.c:796
#6  0x0807f472 in audio_decode_frame (opaque=0xf6d29020, stream=0x8d91778 "",
    len=2048) at ffplay.c:1986
#7  sdl_audio_callback (opaque=0xf6d29020, stream=0x8d91778 "", len=2048)
    at ffplay.c:2087
#8  0xf7e74dcd in ?? () from /usr/lib32/libSDL-1.2.so.0
#9  0xf7e7cb1e in ?? () from /usr/lib32/libSDL-1.2.so.0
#10 0xf7ec781d in ?? () from /usr/lib32/libSDL-1.2.so.0
#11 0xf7e1e96e in start_thread () from /lib32/libpthread.so.0
---Type <return> to continue, or q <return> to quit---
#12 0xf7d8eb5e in clone () from /lib32/libc.so.6

comment:4 Changed 5 years ago by cehoyos

  • Resolution set to fixed
  • Status changed from open to closed

Patch applied, thank you!

Note: See TracTickets for help on using tickets.