Recently The (Multimedia) Mike contacted me and asked if I can look what’s wrong with Clandestiny videos. I did.
First of all it’s worth mentioning that the format obviously originates from Trilobyte as it’d been used in its games years before Quake III was released, it has more features and the decoder in open-sourced Q3 engine still calls it trFMV
.
Then I should mention that RoQ support in Libav
is not great (and in FFmpeg
it’s exactly the same) as the demuxer lacks support for some packet types (like 0x1030
used to signal that it’s a good time to prefetch data), there’s no support for JPEG frames and it goes crazy on files extracted from Clandestiny demo because of all that.
Thus I decided to quickly hack my own decoder for it based on the original description by Dr. Tim Ferguson (yet another forgotten researcher who REd several VQ-based video formats) and played with it to see what’s going wrong.
And it seems the problem was mostly in motion compensation. In some conditions you should double the motion vectors (I think it’s when the first chunk size is zero instead of minus one); also some files have alpha information in the codebook (this is detected by video properties chunk argument being set to one) as it’s apparent from ScummVM
code. In either case it’s just the minor details that make things complicated (and I was lucky not to encounter interlaced mode files).
It was a nice distraction but I guess it’s time to do something else.