Author Archives: Multimedia Mike

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.

Weak On MPEG

I’ve been working tirelessly on the MultimediaWiki for the past few days, importing all of my past technical documents. Plus, I have been unearthing all kinds of documents and notes. Fortunately, my new philosophy is to just get the information out there and organized via the Wiki rather than waiting until the information is perfectly, 100% complete and verified. Some new items:

But what about MPEG? Right now, the Wiki is lacking for information regarding various MPEG audio, video, and transport formats. This was also a shortcoming under the original tech site organization. My big problem is that I simply don’t know a lot of the technical details behind MPEG. That seems to surprise a lot of people familiar with my activities. Fact is, I like to solve problems that need to be solved. Since so many other people seem to have MPEG locked down, I don’t worry about it.

So, to all who are more familiar than I in MPEG matters: What would be a good way to organize MPEG information in the MultimediaWiki?