[FFmpeg-devel] [PATCH] Bink file demuxer and audio decoder

Daniel Verkamp daniel
Wed Jan 14 09:39:28 CET 2009


Attached are patches to add a Bink file demuxer and Bink audio
decoder, plus support for Bink audio in Smacker files.

First of all, I must say that the bulk of these patches is based on
the previous patch by Peter Ross [1]; many thanks to him and anyone
else who helped write the documentation on MultimediaWiki.  I've
attempted to update the documentation where I've noticed inaccuracies,
but I give no guarantees that documentation matches code. :)  I've
tried to fix most of the problems mentioned in the previous thread,
but if I have missed anything important, please point it out.

The first patch is the most problematic; it implements the required
DCT and RDFT functions, but for now they are just wrappers around the
(incompatibly-licensed) fft4g functions the old patch was using.
Hopefully someone will step up to write replacements for these.  I
attempted that myself, but I am no mathematician, and I ended up with
a big mess and a thoroughly muddled brain trying to implement anything
based on the descriptions I could find.

I have only tested the Bink-in-Smacker support with files I created
myself with the latest RAD Video Tools from their website (and it does
work for those - samples can be found at http://drv.nu/temp/SMK/ ); if
anyone has samples of this from actual games, these would be greatly
appreciated.  A small note on the Smacker demuxer: it was using the
SMKA tag even for u8 PCM audio; this didn't seem right, and I haven't
been able to find or create a file with such an audio format, so I'm
not sure it exists at all.  Any samples of this would be interesting

I've tested at least a few samples from every game I have available
that uses Bink, namely:

- Heroes of Might and Magic 3: The files are hidden away inside .vid
archives; they are the only revision 'b' (presumably "beta"?) I could
find, and this format is not playable by the RAD player; none seem to
have audio, unless the headers are different, so the demuxer currently
doesn't support these (a trivial one-line patch of the probe function
will enable it, but there's no way to test if it's actually correct
for now)
- Test Drive 6 (PC version): The only example I could find among my
games of files with the oldest (BIKf) non-beta revision; features a
music video of Fear Factory with Gary Numan performing "Cars" :)
- Diablo 2: Samples I tested all work; see note below
- GTA IV: some very large samples (TV stations), notably with
keyframes; I haven't listened to the entire hour and a half, but the
parts I checked were fine
- Various other games, all of which work: C&C: Generals, L4D,
Psychonauts, COD4, UT3, ...

I also tested the samples at http://samples.mplayerhq.hu/game-formats/bink/ :

- ATI/* has various chunks of files; appending the
--append.this.to.complete.bik to the end of the un-suffixed file
produces the full video, which works; the .x file is just another
truncated part of the video
- thps4/data002.tgr seems to be the only file in that dir that has
audio, and it works
- diablo2/d2xmusic.mpq does not contain any Bink files, but
D2VIDEO.MPQ from the Cinematics CD does contain Bink files, and these
work, as do the ones from the expansion
- ActivisionLogo.bik, AnivisionLogo.bik, logo_collective.bik,
logo_lucas.bik, original.bik: all work
- logo_legal.bik: does not contain any audio

Any samples that don't work (or reports of ones that actually work :),
as well as any critiques on the patch, are quite welcome.

-- Daniel Verkamp

[1] http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-April/045346.html
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-temporary-fft4g-based-DCT-and-RDFT.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090114/4c79b000/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-Bink-audio-decoder.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090114/4c79b000/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0003-Bink-file-demuxer.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090114/4c79b000/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0004-Bink-audio-in-Smacker-files.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090114/4c79b000/attachment-0003.txt>

More information about the ffmpeg-devel mailing list