Ticket #2064 (closed enhancement: fixed)
Support ADPCM_MS in unknown container
| Reported by: | DJX | Owned by: | |
|---|---|---|---|
| Priority: | wish | Component: | avformat |
| Version: | git-master | Keywords: | adpcm_ms |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | yes | |
| Analyzed by developer: | no |
Description
Summary of the bug:
FFmpeg does not recognize ADPCM_MS audio file when audio header is not present.
How to reproduce:
ffmpeg -i radio-orig.wav
ffmpeg version N-48065-g6375318 Copyright (c) 2000-2012 the FFmpeg developers
built on Dec 21 2012 09:13:20 with gcc 4.7.2 (GCC)
configuration: --enable-static --arch=x86_64 --target-os=mingw32 --cross-prefi
x=/home/rdp/dev/ffmpeg-windows-build-helpers/sandbox/mingw-w64-x86_64/bin/x86_64
-w64-mingw32- --pkg-config=pkg-config --enable-gpl --enable-libx264 --enable-avi
synth --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --ena
ble-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-lib
openjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-fontconfi
g --enable-libass --enable-libutvideo --enable-libopus --disable-w32threads --en
able-frei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enable
-libxavs --extra-cflags=-DPTW32_STATIC_LIB --enable-libopencore-amrnb --enable-l
ibopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libbl
uray --enable-libvpx --enable-runtime-cpudetect
libavutil 52. 12.100 / 52. 12.100
libavcodec 54. 81.100 / 54. 81.100
libavformat 54. 49.102 / 54. 49.102
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 29.100 / 3. 29.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
radio-orig.wav: Invalid data found when processing input
ffmpeg -i radio-header.wav
ffmpeg version N-48065-g6375318 Copyright (c) 2000-2012 the FFmpeg developers
built on Dec 21 2012 09:13:20 with gcc 4.7.2 (GCC)
configuration: --enable-static --arch=x86_64 --target-os=mingw32 --cross-prefi
x=/home/rdp/dev/ffmpeg-windows-build-helpers/sandbox/mingw-w64-x86_64/bin/x86_64
-w64-mingw32- --pkg-config=pkg-config --enable-gpl --enable-libx264 --enable-avi
synth --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --ena
ble-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-lib
openjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-fontconfi
g --enable-libass --enable-libutvideo --enable-libopus --disable-w32threads --en
able-frei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enable
-libxavs --extra-cflags=-DPTW32_STATIC_LIB --enable-libopencore-amrnb --enable-l
ibopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libbl
uray --enable-libvpx --enable-runtime-cpudetect
libavutil 52. 12.100 / 52. 12.100
libavcodec 54. 81.100 / 54. 81.100
libavformat 54. 49.102 / 54. 49.102
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 29.100 / 3. 29.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[wav @ 000000000225dfe0] max_analyze_duration 5000000 reached at 5002667
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'radio-header.wav':
Duration: 24:51:18.49, bitrate: 0 kb/s
Stream #0:0: Audio: adpcm_ms ([2][0][0][0] / 0x0002), 48000 Hz, stereo, s16,
384 kb/s
At least one output file must be specified
Change History
comment:2 Changed 6 months ago by cehoyos
- Keywords header removed
- Component changed from avcodec to undetermined
How was radio-orig.wav produced? Which software plays radio-orig.wav ?
comment:3 Changed 6 months ago by DJX
I do not know how it was produced.
It plays in a video game: Call of Duty Black Ops.
I don't know if they removed the header to save space (doubtful) or for obfuscation purposes.
comment:4 Changed 6 months ago by cehoyos
Do I understand you correctly that the file is found as-is on your drive if Call of Duty Black Ops is installed / that the exact file can be found on the DVD?
comment:5 Changed 6 months ago by DJX
Yes.
The files are inside an archive system, which when read through, make up the file system for the game. You can extract the files with 7-Zip and obtain many more samples. This is most likely an obfuscation attempt.
comment:6 Changed 6 months ago by cehoyos
- Status changed from new to open
- Version changed from unspecified to git-master
- Component changed from undetermined to avformat
- Reproduced by developer set
comment:7 Changed 6 months ago by cehoyos
Could you compare the first 64 bytes of a few samples (or provide them)?
At least the sample-rate is stored in a short header afaict, it may be possible to autodetect the format.
comment:8 Changed 6 months ago by DJX
I will leave it to better men to investigate properly.
For more samples, please feel free to browse the directory of:
http://www.djxmmx.net/ffmpeg/2064/
All original/unmodified samples from the game.
The only file in which I manually added a header is: http://www.djxmmx.net/ffmpeg/2064/radio-header.wav
I can add more samples to that directory if you need.
Just let me know.
Thank you
comment:9 Changed 5 months ago by richardpl
- Status changed from open to closed
- Resolution set to invalid
This bug report is pure nonsense. There is no way to support something that can be anything...
If you want support for raw generic (de)muxer where you manually specify audio codec parameters please open new bug report.
comment:10 Changed 5 months ago by cehoyos
- Status changed from closed to reopened
- Resolution invalid deleted
It looks valid to me...
comment:11 Changed 5 months ago by richardpl
- Summary changed from Missing ADPCM_MS header to raw audio demuxer
comment:12 Changed 5 months ago by cehoyos
Did you look at the files? They do not look like raw audio to me...
comment:13 Changed 5 months ago by richardpl
They are not raw audio, they are headerless -raw - adpcm compressed
comment:14 Changed 5 months ago by cehoyos
What do you mean with headerless?
Afaict, the files contain a header that at least shows the number of channels in the file (afaiu, this is essential for decoding).
Or do I misunderstand?
comment:15 Changed 5 months ago by richardpl
Even if you assumption is correct there is still no way to automagically conclude that it have adpcm.
comment:16 Changed 5 months ago by cehoyos
- Summary changed from raw audio demuxer to Support ADPCM_MS in unknown container
Maybe "30 08" tells us or the file format only supports adpcm_ms?
Since so far we only have adpcm_ms samples, the assumption looks not dangerous to me in any way.
comment:17 Changed 5 months ago by richardpl
Only 2 bytes? That is hardly useful. How would you name your new demuxer? 3008?
comment:18 Changed 5 months ago by cehoyos
wav also uses two bytes to identify the codec...
Or do you mean the probing of the file?
Apart from the fact that demuxers without probe function exist, the header is quite long, so it should be possible to write a probe function that is at least not less strict than other existing probe functions.
comment:19 Changed 5 months ago by richardpl
How long is that header? Can you show here header for all files?
comment:20 Changed 5 months ago by cehoyos
The header is 2096 bytes afaict, mostly filled with "0".
comment:21 Changed 8 weeks ago by cehoyos
- Status changed from reopened to closed
- Resolution set to fixed
Implemented by Michael, if any additional information is available like the actual file format name or if other codecs can be used, please share it!



Original file:
http://www.djxmmx.net/ffmpeg/2064/radio-orig.wav
File with ADPCM_MS header manually added:
http://www.djxmmx.net/ffmpeg/2064/radio-header.wav