Opened 4 years ago

Closed 8 months ago

#1579 closed defect (fixed)

fix remuxing of imaadpcm in wav

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

Description

ms codec can't decode remuxed file because frame_size is set to 0 with "-acodec copy"

http://samples.mplayerhq.hu/A-codecs/ima-adpcm/test_ima_adpcm.wav

libavformat/riff.c:

    } else if (enc->codec_id == CODEC_ID_GSM_MS || enc->codec_id == CODEC_ID_ADPCM_IMA_WAV) {
        hdrsize += 2;
        bytestream_put_le16(&riff_extradata, frame_size); /* wSamplesPerBlock */
+        av_log(enc, AV_LOG_WARNING, "frame_size: %d\n", frame_size);
C:\>ffmpeg -i test_ima_adpcm.wav -acodec copy out.wav
ffmpeg version N-42891-g9054f6b Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul 26 2012 02:25:40 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      51. 65.100 / 51. 65.100
  libavcodec     54. 44.101 / 54. 44.101
  libavformat    54. 20.100 / 54. 20.100
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3.  3.100 /  3.  3.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, wav, from 'test_ima_adpcm.wav':
  Duration: 00:00:06.28, bitrate: 32 kb/s
    Stream #0:0: Audio: adpcm_ima_wav ([17][0][0][0] / 0x0011), 8000 Hz, mono, s
16, 32 kb/s
Output #0, wav, to 'out.wav':
  Metadata:
    encoder         : Lavf54.20.100
    Stream #0:0: Audio: adpcm_ima_wav ([17][0][0][0] / 0x0011), 8000 Hz, mono, 3
2 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=      25kB time=00:00:06.31 bitrate=  32.5kbits/s
video:0kB audio:25kB subtitle:0 global headers:0kB muxing overhead 0.234375%

Attachments (1)

patchadpcmwav.diff (616 bytes) - added by cehoyos 3 years ago.

Download all attachments as: .zip

Change History (8)

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

Since remuxing appears to succeed: Is there a problem with the resulting file?
Or do I misunderstand?

comment:2 in reply to: ↑ 1 Changed 4 years ago by ami_stuff

Replying to cehoyos:

Since remuxing appears to succeed: Is there a problem with the resulting file?
Or do I misunderstand?

The problem here is that the remuxed file does not decode with ms ima adpcm codec because frame_size is always set to 0.

Version 0, edited 4 years ago by ami_stuff (next)

comment:3 Changed 4 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Status changed from new to open
  • Version changed from unspecified to git-master

comment:4 Changed 4 years ago by cehoyos

  • Keywords adpcm wav added

Changed 3 years ago by cehoyos

comment:5 Changed 3 years ago by cehoyos

Possible patch attached.

comment:6 Changed 8 months ago by richardpl

So what is status of this?

comment:7 Changed 8 months ago by cehoyos

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

Fixed by nu774 since 43c18fec

Note: See TracTickets for help on using tickets.