Opened 11 years ago

Last modified 3 years ago

#1965 open defect

mmf: support correctly formats ma-3/5/7

Reported by: ami_stuff Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: adpcm smaf
Cc: zane@zanevaniperen.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

When I remove these check form "libavformat/mmf.c" then ma-3/5/7 samples decodes, but sample rate (and channels count for stereo files) is identified incorrectly.

    /* Tag = "ATRx", where "x" = track number */
-   if ((tag & 0xffffff) == MKTAG('M', 'T', 'R', 0)) {
-        av_log(s, AV_LOG_ERROR, "MIDI like format found, unsupported\n");
-        return -1;
-    } 
-    if ((tag & 0xffffff) != MKTAG('A', 'T', 'R', 0)) {
-        av_log(s, AV_LOG_ERROR, "Unsupported SMAF chunk %08x\n", tag);
-        return -1;
-    }




    /* Make sure it's followed by an Awa chunk, aka wave data */
-    if ((tag & 0xffffff) != MKTAG('A', 'w', 'a', 0)) {
-        av_log(s, AV_LOG_ERROR, "Unexpected SMAF chunk %08x\n", tag);
-        return -1;
C:\>ffmpeg -i ma3.mmf
ffmpeg version N-46755-ge70144c Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov 15 2012 02:38:20 with gcc 4.5.0 (GCC) 20100414 (Fedora MinGW 4.5.
0-1.fc14)
  configuration: --prefix=/var/www/users/research/ffmpeg/snapshots/build --arch=
x86 --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --cc='ccache i686-pc-min
gw32-gcc' --enable-w32threads --enable-memalign-hack --enable-runtime-cpudetect
--enable-cross-compile --enable-static --disable-shared --extra-libs='-lws2_32 -
lwinmm -lpthread' --extra-cflags='--static -I/var/www/users/research/ffmpeg/snap
shots/build/include' --extra-ldflags='-static -L/var/www/users/research/ffmpeg/s
napshots/build/lib' --enable-bzlib --enable-zlib --enable-gpl --enable-version3
--enable-nonfree --enable-libx264 --enable-libspeex --enable-libtheora --enable-
libvorbis --enable-libfaac --enable-libxvid --enable-libopencore-amrnb --enable-
libopencore-amrwb --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx
  libavutil      52.  6.100 / 52.  6.100
  libavcodec     54. 71.100 / 54. 71.100
  libavformat    54. 36.100 / 54. 36.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 23.100 /  3. 23.100
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[mmf @ 0x1edc280] MIDI like format found, unsupported
ma3.mmf: Operation not permitted

Attachments (10)

ma2_mono_8khz.mmf (117.4 KB ) - added by ami_stuff 11 years ago.
ma3_mono_8khz.mmf (117.4 KB ) - added by ami_stuff 11 years ago.
ma5_mono_8khz.mmf (117.4 KB ) - added by ami_stuff 11 years ago.
ma5_stereo_8khz.mmf (234.7 KB ) - added by ami_stuff 11 years ago.
ma7_mono_8khz.mmf (117.5 KB ) - added by ami_stuff 11 years ago.
ma7_stereo_8khz.mmf (234.7 KB ) - added by ami_stuff 11 years ago.
ma1_midi.mmf (1.5 KB ) - added by ami_stuff 11 years ago.
ma2_midi.mmf (6.0 KB ) - added by ami_stuff 11 years ago.
ma3_midi.mmf (5.0 KB ) - added by ami_stuff 11 years ago.
ma5_midi.mmf (5.0 KB ) - added by ami_stuff 11 years ago.

Download all attachments as: .zip

Change History (17)

by ami_stuff, 11 years ago

Attachment: ma2_mono_8khz.mmf added

by ami_stuff, 11 years ago

Attachment: ma3_mono_8khz.mmf added

by ami_stuff, 11 years ago

Attachment: ma5_mono_8khz.mmf added

by ami_stuff, 11 years ago

Attachment: ma5_stereo_8khz.mmf added

by ami_stuff, 11 years ago

Attachment: ma7_mono_8khz.mmf added

by ami_stuff, 11 years ago

Attachment: ma7_stereo_8khz.mmf added

comment:1 by Carl Eugen Hoyos, 11 years ago

Keywords: adpcm mmf added
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

comment:2 by Carl Eugen Hoyos, 11 years ago

Keywords: smaf added; mmf removed

by ami_stuff, 11 years ago

Attachment: ma1_midi.mmf added

by ami_stuff, 11 years ago

Attachment: ma2_midi.mmf added

by ami_stuff, 11 years ago

Attachment: ma3_midi.mmf added

by ami_stuff, 11 years ago

Attachment: ma5_midi.mmf added

comment:3 by ami_stuff, 11 years ago

I attached also the real mmf midi files.

comment:4 by compn, 11 years ago

some mmf in sample repo too, never tested them:
http://samples.ffmpeg.org/A-codecs/suite/MMF/

also this one would be nice to know what it really is:
http://samples.ffmpeg.org/A-codecs/format-0x20-laugh.mmf

comment:6 by Elon Musk, 11 years ago

Component: undeterminedavformat

comment:7 by zane, 3 years ago

Analyzed by developer: set
Cc: zane@zanevaniperen.com added

I've just had a look at the spec (http://read.pudn.com/downloads34/sourcecode/comm/mms/107584/SMAF3.06e.pdf), and I'm pretty sure what's being heard when the checks are removed is the "Score Track Stream PCM Data Chunk" (Mtsp) part of the MTR chunk.

There's a bit of static at the start too, which suggests that's the rest of the chunk being decoded as adpcm.

I'd be inclined to say the current behaviour is correct.

Note: See TracTickets for help on using tickets.