Category Archives: Open Source Multimedia

News regarding open source multimedia projects.

Duck TrueMotion 1 Progress

Reimar Döffinger has submitted some work for FFmpeg’s Duck TrueMotion 1 decoder. Now the decoder can output a frame that looks reasonably correct but only paints the left half of the frame:


Sonic 3D Blast - Left Half

So we’re close, we’re very close on this variant. My guess would be that the OUTPUT_PIXEL_PAIR(), which is used in both the 16- and 24-bit variants, is not doing the right thing in the latter mode.

Further, Kostya has fixed some bugs in the TrueMotion 1 data tables that caused decoding problems with the data files from Phantasmagoria: A Puzzle of Flesh.

One more problem (which may or may not be a single problem): I still have several 16-bit TM1 samples that do not decode correctly. They decode as colorful static that looks like this:


Bug Decoding Bug

Duck TM1 actually produces some very curious artifacts due to its bidirectional predictive coding method and this frame does not do the artifact bug justice. Incidentally, this particular frame comes from the the sampler disc for the Sega Saturn game Bug! and the file can be found in the samples archive: http://samples.mplayerhq.hu/V-codecs/DUCK/ (file is bugsampler-m01-16bit.avi).

What could be the problem? Many of the frames toss off the error message “help! truemotion1 decoder went out of bounds” which is a message I added in the early days of development to indicate that the decoder had exhausted the encoded bytestream. My first impulse is that there must be something wrong with the data tables. Seems unlikely, though, since I more or less ripped the tables directly from the original VpVision source. As for the tables I had to retype, Kostya has apparently corrected mistakes in those.

There are 3 large, important tables found in libavcodec/truemotion1data.h: pc_tbl2[], pc_tbl3[], and pc_tbl4[]. Where’s pc_tbl1[]? Darned if I know but I guess the original source didn’t need it or declare it. Tables #2 and 4 begin with 10 and 9 4-entry delta runs, respectively. Table #3, however, has no 4-entry delta runs. Thus, if table #3 were mistakenly selected instead of 2 or 4 and the bytestream had a good number of low-numbered delta indices, the bytestream would be exhausted sooner than it should be.

Where are these tables selected? In TM1’s overly-complicated header decoding logic. It may be time to review that for correctness.

Latest Apple Trailers

I got my AMD64 machine back in January and installed a native 64-bit Linux OS on it. One of the first things I discovered is that I could not watch most Apple QuickTime movie trailers since they used the QDesign Music Codec (QDM2) for audio which, until recently, only worked under Linux on i386-type architectures using Apple’s Win32 binary decoder. The xine team finished hooking up FFmpeg’s QDM2 support this past weekend (it’s in CVS right now). So I thought I would finally get to enjoy a tremendous backlog of movie trailers that have been piling up since last January.


QuickTime 7
Then along came QuickTime version 7…

Now, it seems that all current QuickTime movie trailers available directly from Apple have moved to using H.264/AVC1 for video and AAC for audio. I had seen that Apple was starting to post hi-def QT trailers (480P, 720P, and 1080P) but I was unaware that the higher variations also have 5.1 AAC audio.

BTW, if you want Apple trailers but do not wish to put up with working through Apple’s site to find the correct link, Dave’s Trailer Page has an amazing archive of direct movie trailer links in no-nonsense HTML.

Wouldn’t you know, when the open source community reverse engineers an implementation of QDM2 Apple quits using it for the majority of their material. The same thing happened in 2002 when the open source community got an implementation of Sorenson Video 1 (SVQ1) and Apple started using SVQ3. Fortunately, the community got open source SVQ3 support when SVQ3 was still quite common. But it’s like Apple is always one step ahead. Maybe that’s why I can never keep straight the 53 or so different variations of iPods.

Duck TrueMotion 1 Redux

Some time ago, Alex Beregszaszi and I created an FFmpeg video decoder to handle Duck TrueMotion 1 data. However, there are two major variations of this data format: 16-bit and 24-bit. The FFmpeg decoder presently only handles 16-bit data. There is a non-negligible number of games from the mid- to late-1990s that used this format for their FMV and many of them use the 24-bit variant.


Virtua Cop 2 Intro
Virtua Cop 2, Sega Saturn,

one of the Duck TM1-using games that uses the 16-bit variant

Continue reading