There’s this game (or interactive movie rather) called Flash Traffic: City of Angels from Tsunami media that had two editions: DOS one that used BFI videos and DOS edition that relied on special MPEG accelerator for its MPEG-1 videos.
The Multimedia Mike had some interest in it so I decided to look what’s so special about those MPEG videos and why they can’t be played (they produce a lot of garbage if played with the usual players).
Those files seem to be intended for playback only on the special hardware, namely RealMagic card (I’d rather have MPEGMagic card for hardware-accelerated playback of RealVideo thank you very much) that has a special driver for interfacing it (RMDEV.SYS
and FMPDRV.EXE
). The game engine simply invokes FMPDRV.EXE
for MPEG playback and there’s no software playback (considering how powerful machines were back in the day, playing back 352×240 MPEG-1 videos on them was next to impossible, hence the need for special cards offloading the work).
So I had to look inside in faint hope to see what can go wrong.
First of all, I don’t have MPEG-1 specifications and I don’t want to pay ISO hundreds of francs for a copy (and I could not find them online). So I downloaded ITU H.222.0 and H.262 standards (that correspond to MPEG-2 systems and video standards but are free) and used them as the reference (H.262 even lists the changes from MPEG-1 video). Then I tried to hack a simple raw stream demuxer, packetiser and video decoder in NihAV
to see what goes there.
The container format seems to be the standard MPEG PS so demuxing was not a big problem. Video has some problems though. The first sign is framerate code: by the standard it should be 1-8, in that video it’s 12. In libavcodec
this code maps to an unofficial 12fps mode introduced by libmpeg3
but the file obviously predates that library by many years (and avconv
reports 13.3 fps anyway for some reason). Also by analysing group start timecode and GOP structure it seems that the real framerate is standard 30fps. Thus my conclusion is that those files were coded in slightly wrong way and marked with an invalid framerate code to make sure that compliant players won’t try to play them (and only the special videocards will). And considering that even I-frames can’t be always decoded properly, the encoder they used probably was not compliant either.
It is rather hard to find out what’s wrong with the bitstream so I’m not going to continue the efforts but at least I checked it out and verified that the files are not fully compliant and can be decoded correctly only by chance.
Also now I have even less desire to play with MPEG formats but I’ve never been a big fan of them anyway.
Thanks for taking a look. Seems like we might have another situation like with Sega’s CPK files where they deliberately corrupted the stream so that standard decoders wouldn’t be able to handle it.
Feels like the most straightforward way they could have customized the codec for their use was with a different set of entropy tables.
The fun thing is that I-frames are decoded fine, it’s P- and B-frames that have errors (so maybe they’ve fiddled with macroblock header coding and nothing else).
Bad thing is that even if this is the case it won’t be possible to distinguish between those and “normal” MPEG videos reliably.