Author Archives: Multimedia Mike

Another Round of Samples and Tests

Thanks to all of the advice in the comments of the last post about filling in gaps in the FATE test coverage, I have staged 11 new FATE test specs:

Regarding that group of 6 Sun raster files, it’s interesting to note that the 24-bit raw Sun raster file sample is smaller than the 24-bit RLE version.

I encountered a few problems with the suggestions from the last post. Among them:

  • ami_stuff came through with a sample of a Fibonacci-encoded 8svx file. Unfortunately, it’s attached to a bug report because it’s not presently working. Test not staged.
  • I downloaded the free Command & Conquer games from EA and looked into Tiberian Sun specifically. It looks like all the game resources are wrapped up into .MIX files. Not a big deal– I wrote a program years ago to take these apart. Unfortunately, the files are in a different MIX file format, apparently. So I’m still stuck on trying to get the audio samples I need.
  • Carl Eugen pointed to a sample of Blu-Ray PCM (mpegts+h264+++trunc_read_packet_loop.m2ts). Thing is, the file has 9 streams; the pcm_bluray stream is right in the middle. I still don’t know how to tell FFmpeg to select that stream.
  • On the subject of files that have more than 1 audio and 1 video stream, most of these samples with subtitles have the same problem as encountered with the last item– I don’t know how to tell FFmpeg to process the subtitle stream. In fact, the sample from the previous item also has 4 pgssub streams. How do I select one? And will I be able to cleanly mux a subtitle stream into the framecrc format?

I think FFmpeg’s -map option may hold the key. But I’m a little too tired and annoyed to read the source code which I’m certain is the only true documentation for how it works.

Call for Samples

In my last post regarding recently-staged FATE tests, a number of Amiga sentimentalists expressed willingness to help me track down multimedia formats that were prevalent on that platform. To that end, I ask: Where do I find Fibonacci-encoded 8svx files? 8svx files can contain several audio codecs, but I have been unable to find ones with the Fibonacci format.

While we’re on the subject, I may as well put out a general call for samples that have eluded me:

  • Fibonacci-encoded 8svx samples, as mentioned above
  • ASS/SSA samples; plus, is there any good way to test ASS/SSA subtitles using ‘ffmpeg’?
  • ADTS AAC: How do I generate that? I thought faac was supposed to help me with that but I couldn’t seem to get ADTS out of it.
  • raw Ingenient MJPEG
  • I know how to generate MPC (vs. MPC8 files, which I have already covered); the demuxer just doesn’t seem to work correctly right now.
  • There are a number of formats like NC camera feed format, rtsp, and sdp that I suspect are impossible to test from disk rather than network.
  • TXD: I think this is a raw format and that I have to supply parameters from the command line to decode it properly. I think these are valid TXD files but I don’t know their resolution (or, indeed, if they’re single images since TXD is supposed to be a texture dictionary).
  • pcm_bluray and pcm_dvd: any VOBs in the archive with these data types?
  • pcm_s16le_planar: Based on my code excavation, this is used in certain EA chunked formats, such as in NBA Live 2003 according to our wiki page on EA formats. We lack samples in the archive for that game. However, this reminds me that I really should modify the FILM/CPK demuxer so that it outputs planar audio instead of interleaving the audio in the demuxer (maybe someone else wants to get on top of that, if they’re looking for an easy task).
  • pgssub, xsub: again, where are samples and how do I test subtitle formats?
  • Sunplus JPEG (SP5X)
  • Sun Rasterfile image
  • Westwood Audio (SND1)

There are plenty of formats not covered yet according to the FATE test coverage page. For formats which have both an encoder and decoder in FFmpeg, I plan to have a better system in place in the next FATE version for testing those (which will also obviate the need for the {MAKETEST} test spec). Then there are the non-bitexact formats that require more advanced testing features which are in development.

Meanwhile, I learned that MPEG-4 ALS actually does have a formal conformance suite available (you can usually count on that for MPEG standards; take that, Xiph). So I will be disabling the current ad-hoc test spec and have staged 6 of the conformance vectors known to be correct (based on features that have been implemented thus far): 00, 01, 02, 03, 04, and 05. Further, 2 more new specs: iff-byterun1 and frwu are ready to go.

WMA Voice in FFmpeg

Ronald Bultje has been a long-time contributor to a variety of open source multimedia projects. He was keen to try his hand at reverse engineering and implementing an undiscovered codec. Most people start simple, but Ronald went for a vocoder (significantly more complex than the piddly little ADPCM codecs I started with). He has completed his reverse engineering of the Windows Media Audio 9 Voice algorithm and committed a decoder for FFmpeg. If you’re interested in the technical details, check out Ronald’s blog posts on the matter: Codec Woes and WMA Voice Codec Dissection.

Here is a WMA Voice file being played in FFplay using Michael’s spectrum visualization (now the default audio visualization):


FFplay's spectrum analyzer playing a WMA Voice file

SVN To Twitter Gateway

Here’s one of those projects that you dream up just to avoid doing more important/useful work: FFmpeg SVN to Twitter gateway. I, too, am now contributing to the notorious fail whale.

All the kids are talking about this Twitter thing these days. I have read up on some kind of open API they offer. I’m not really that keen on these modern web-based APIs. I had a feeling that someone must have a Python API for it and sure enough: python-twitter. So that takes care of that half of the gateway.

The other half is interfacing to FFmpeg SVN. I already have this part reasonably figured out thanks to FATE— my current method is to simply execute ‘svn’ via shell and parse the stdout. It seems that there are a few cleaner Python-oriented solutions for this. But all I really need is to parse the current revision number from ‘svn info’ and then parse the output of ‘svn log -r <rev>’.

Perhaps the craziest part of my solution is that I’m using an sqlite3 database to store a single piece of data– the revision. Hey, I just find it to be the simplest solution, oddly enough.

I imagine it would be possible to engineer the Twitter update as a function triggered during a commit. However, I tend to think it’s not a good idea to have a commit trigger that is dependent on an RPC call to a web service that has a tenuous uptime reputation.

Now to sit back and see if anyone actually follows the account (besides spammers).