Monthly Archives: February 2006

AVS Implementation

Thanks to Aurelien Jacobs for implementing a complete FFmpeg playback system for the AVS format. And thanks again to VAG for reverse engineering the system in the first place. It takes dedication to work on such a format that was used in one known game, Creature Shock. Well, more than one if you count the DOS, 3DO, Sega Saturn, and CD-i versions separately, and even more than that if you count the special “director’s” edition (I still need to log that one into MobyGames).

To be fair, the people behind Creature Shock went on to make a few other video games that you likely never heard of, like Alien Odyssey and FX Fighter. Both of these games contained FMV (the former being another FMV-driven game) and the formats are suspected to be influenced by AVS.

Basic FFmpeg Hacking

A few more people have expressed interest in writing file demuxers and audio/video decoders for the FFmpeg project. I present herewith a brief guide to creating both demuxers and decoders for that project.

Start with the demuxer:

  • copy one of the simpler formats (libavformat/idcin.c or idroq.c) to a new file and start modifying the key parts
  • edit libavformat/allformats.c and libavformat/avformat.h and add the proper _init() function
  • edit libavformat/Makefile and add the new file to the end of the OBJS list

You should be able to build the new demuxer module into the project now. Check ‘ffmpeg -formats’ to make sure. You can use printf()’s or gdb along with the ffmpeg for debugging.

Next is the video decoder:

  • copy one of the simpler video decoders (libavcodec/msrle.c or msvideo1.c) to a new file and start modifying the key parts
  • edit libavcodec/avcodec.h and add a new CODEC_ID; also add the new data structure declared at the end of the new file
  • edit libavcodec/allcodecs.c and add the new data structure there as well
  • edit libavcodec/Makefile and add the new file to the end of the OBJS list

It helps to recompile the entire project after adding a new CODEC_ID just to make sure it “takes”. ‘ffmpeg -formats’ should now report the new format. Proceed with development and debugging. Note that in libavcodec, printf()s are forbidden. Use av_log(NULL, AV_LOG_INFO, …) instead.

Mad Dog McCree And TTA

I finally got up out of my chair, ambled across the room to my big CD-ROM folder, got out the Mad Dog McCree disc, unpacked the LIB GRAF file, so that I could finally test and commit Peter Ross’ ALG-MM playback system for FFmpeg. If you have any of the very early multimedia titles by American Laser Games you should be able to use the latest CVS version of FFmpeg to play the cheesy, low-resolution, low-framerate multimedia. Further, I have placed some select samples here.


Mad Dog McCree

Also, Alex has submitted a native FFmpeg playback system for the True Audio (TTA) lossless format. Next up: Kostya is working on a native decoder for a format I had not heard of yet called ZMBV which is apparently an open source codec used to capture video in the DOSBOX application.

VOC Support

Thanks to Aurelien Jacobs for the new FFmpeg VOC subsystem. I want to express my particular gratitude that he did everything right in the process:

For the uninitiated, the VOC format was a.k.a. the Creative Voice file format which was tied to specific multimedia hardware, as was the case with so many old multimedia formats. This format was tied to the original line of Creative Labs’ Sound Blaster audio cards, so much so that the format actually stored the Sound Blaster DAC frequency divisor for PCM data. VOC files originally stored PCM or any of the custom ADPCM formats that SB hardware apparently supported, including a 2.6-bit format. Details of these custom formats are unknown.