I received a promotional video screen with a USB interface. It comes with a couple example videos, one of which is here: https://drive.google.com/file/d/1B-wSURAgK-ePrfpKFM5nYbNhQ5mD-Ii2/view?usp=sharing md5sum 506a6c478b0874262802e8ae7d718c59

I'd love to figure out how to generate this file format, but I don't have much experience in reverse engineering. It seems to be a mostly normal AVI file, and can play in VLC just fine.

What I've got so far

I've been poking around with ffprobe, in a hex editor, and RiffPad, and found the following things:

  • it is a RIFF AVI with 2 streams - video and audio
  • the video frames are mjpeg - specifically mjpeg/AVI1, header FF D8 FF E0 00 10 41 56 49 31
  • the video frames are padded to the dword boundary instead of the word boundary which seems to be the standard. Riffpad and other such tools complain about this
  • ffmpeg -i original.avi -codec copy test.avi doesn't produce a working file - ffmpeg appends junk lists to some of the header information. deleting the lists and aligning frames to the dword boundary make the file play despite some differences in the header data.
  • I'm having a hard time finding a tool to generate similarly formatted frames. FFMPEG wants to generate JFIF data instead of AVI1, which doesn't work. Judging by this source, the original frames contain their own huffman encodings, and the container file lists the chunks as dc chunks, so compressed images. jpegtoavi generates db segments, which I can't copy over.

Any help with what to do next would be very appreciated.

  • I've mostly resolved to figuring this out by myself. Given that VLC reads the frames and video itself with no issue I know I'm dealing with someone that should be reasonable - it looks like a bog-standard MJPEG, 4:2:0 subsampling, the 4 standard huffman tables embedded for some reason and 2 quantization tables. I've found the BinData gem and I'm bitbanging this out
    – rsheldiii
    Jan 19, 2020 at 5:40


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.