Author Archives: Multimedia Mike

Palette Communication

If there is one meager accomplishment I think I can claim in the realm of open source multimedia, it would be as the point-man on palette support in xine, MPlayer, and FFmpeg.


Palette icon

Problem statement: Many multimedia formats — typically older formats — need to deal with color palettes alongside compressed video. There are generally three situations arising from paletted video codecs:

  1. The palette is encoded in the video codec’s data stream. This makes palette handling easy since the media player does not need to care about ferrying special data between layers. Examples: Autodesk FLIC and Westwood VQA.
  2. The palette is part of the transport container’s header data. Generally, a modular media player will need to communicate the palette from the file demuxer layer to the video decoder layer via an out-of-band/extradata channel provided by the program’s architecture. Examples: QuickTime files containing Apple Animation (RLE) or Apple Video (SMC) data.
  3. The palette is stored separately from the video data and must be transported between the demuxer and the video decoder. However, the palette could potentially change at any time during playback. This can provide a challenge if the media player is designed with the assumption that a palette would only occur at initialization. Examples: AVI files containing paletted video data (such as MS RLE) and Wing Commander III MVE.

Transporting the palette from the demuxer layer to the decoder layer is not the only be part of the battle. In some applications, such as FFmpeg, the palette data also needs to travel from the decoder layer to the video output layer, the part that creates a final video frame to either be displayed or converted. This used to cause a problem for the multithreaded ffplay component of FFmpeg. The original mechanism (that I put into place) was not thread-safe– palette changes ended up occurring sooner than they were supposed to. The primary ffmpeg command line conversion tool is single-threaded so it does not have the same problem. xine is multi-threaded but does not suffer from the ffplay problem because all data sent from the video decoder layer to the video output layer must be in a YUV format, thus paletted images are converted before leaving the layer. I’m not sure about MPlayer these days, but when I implemented a paletted format (FLIC), I rendered the data in higher bit depths in the decoder layer. I would be interested to know if MPlayer’s video output layer can handle palettes directly these days.

I hope this has been educational from a practical multimedia hacking perspective.

Android Multimedia

I honestly do not understand much about Google’s new Android platform. But if I gather correctly from the surrounding hype and press releases, it’s the answer to all of my prayers and will make every single one of my dreams come true.

If you’re like me (and, let’s face it, if you read this blog then you probably are), you are interested in the multimedia features of this proposed platform.


Android phone logo image

The literature that I have perused thus far has not made any remarkable claims with respect to multimedia capabilities amidst all the other wish-granting facets of the phone framework. The above picture, which seems to be the mascot image, specifically sports that ubiquitous symbol of multimedia playback — the rightward-facing arrow in a circle.

Since “open source” is a key selling point of this platform, what are they going to use for a general multimedia backend? I can hardly imagine.

IDA Pro Freeware Update

Thanks to igorsk for informing me that DataRescue has made an updated version of IDA Pro available as freeware. No longer must we suffer the quirks of the old freeware version 4.3– we get to learn a whole new set of idiosyncrasies with 4.9.


DataRescue IDA Pro -- Improved version available

The sales folks at DataRescue told me that this freeware release was in the works– to pacify me when they refused to sell me a license for the full version of IDA Pro. Interesting business model.

Dear Nano

Dear Nano: You know I love you. You are the GPL’d heir to the old UW-Pine-derived Pico editor, my text-editing savior when I was unceremoniously thrust onto the Unix command line early in my computer science education and told to write a program.

However, clever error messages may seem funny to you but are actually aggravating to the end user due to their failure to actually articulate what went wrong:


GNU Nano - Be Reasonable

This is not helpful when a user is trying to be productive and honestly has no idea what misstep just occurred. Fortunately, I have been using using GNU Nano long enough to know that “Come on, be reasonable” usually means that, rather than pressing Ctrl-W to search for text, I mistakenly pressed Ctrl-/ (go to line number) and entered a non-numeric value.

I wonder if non-English-speaking users have to put up with the same error message? Using my limited ability to interpret non-English languages, I delved into the .po files in the Nano source. Well, what do you know?

de.po:

msgid "Come on, be reasonable"
msgstr "Komm schon, sei vernünftig"

fr.po:

msgid "Come on, be reasonable"
msgstr "Allez, soyez raisonnable"

it.po:

msgid "Come on, be reasonable"
msgstr "Avanti, sii ragionevole"

This is especially egregious since “come on” is literally translated and I doubt that the idiom has the same connotation in other languages.

Thankfully, a brief perusal of the other msgid strings does not immediately reveal any other unintuitive errors. As a bonus, I just figured out that Nano must have a bracket-matching feature due the presence of such strings as “Not a bracket” and “No matching bracket”.