Log in

View Full Version : Need help reverse engineering an archaic Video Format


TrekkiesUnite118
7th July 2019, 07:10
I'm not sure if this is the right place to ask this, but I figured it was worth a shot. I'm currently working on a Translation patch for the Sega Saturn version of Grandia. However one area I'm struggling with is the game's cutscenes. These are video files and a few of them will need subtitles added to them. However these video files do not appear to be in line with any standard format used on the Saturn. Saturn Games usually uses one of these three Video Codecs for it's FMVs:

1) Cinepak:
https://wiki.multimedia.cx/index.php/Sega_FILM

2) Duck True Motion:
https://wiki.multimedia.cx/index.php/Duck_TrueMotion_1

3) MPEG (Either using MPEG Softdec or true MPEG-1 using the Video CD Card).

Grandia does not appear to use any of these. Here are some examples of the videos in action:

https://www.youtube.com/watch?v=ixQs9pTKac0
https://www.youtube.com/watch?v=MWMviQPo6V4

The files themselves are actually stored as .MOV files and have Apple Quicktime headers in them. However, the metadata in these headers appears to be misleading and all versions of Quicktime I've tried are unable to play them.

According to the Quick Time Header the video codec is Cinepak, and the resolution is 320x224. While Cinepak may indeed be what's being used, the resolution is definitely not correct. The video files are full screen and run in the Saturn's 352x448i resolution. So if you just grab the image from VRAM in an emulator you get this:

https://i.imgur.com/gxoy6qy.png

I'm guessing that the interlaced mode is being used to try and line double the image and maybe hide compression artifacts. So my guess is that the actual resolution of these videos is 352x224.

The audio however is definitely ADX. You can see ADX headers in the files and you can extract out chunks with a hex editor and play them back in an ADX player with no issue.

Some more info has been compiled together here by others:

https://wiki.multimedia.cx/index.php/Apple_Grandia_Data

I'm thinking that if I can get the audio and video tracks extracted in their entirety it might be easier to figure out what video format is being used, but I have no idea how to go about doing that and I haven't had much luck in finding tools that could do it.

At the end of the day, I need to be able to decode these video files, and then re-encode new ones for the few scenes that will need subtitles added to them. While I'm no stranger to using video encoding and decoding tools, from a programming standpoint and the actual theory of how it works I'm completely out of my element and have no idea where to start. So I'm reaching out for any help I can get. If anyone has any experience with this or would be interested in taking on an interesting challenge I'd greatly appreciate it.

If it's not against the rules I can provide example files from the game.

huhn
7th July 2019, 08:26
provide a sample plz.

TrekkiesUnite118
7th July 2019, 08:45
provide a sample plz.

Sure, assuming it's not an issue. This should be the intro movie that plays before the title screen in the first video I linked:

https://mega.nz/#!qtkDkAKB!JZYNzxI9NWeD4PjJ9pawmjSrnIsLY0EgEkZAZVxX3rQ

huhn
7th July 2019, 09:03
i can't play it as expected but according to lav splitter it is a 320x240 15 FPS RGB24 cvid file.

you provided a sample now so i hope for you someone else on this forum that knows this stuff will have a look.

TrekkiesUnite118
7th July 2019, 17:03
i can't play it as expected but according to lav splitter it is a 320x240 15 FPS RGB24 cvid file.

you provided a sample now so i hope for you someone else on this forum that knows this stuff will have a look.

Yeah, that matches up with what's in the QuickTime header. Though I'm pretty sure at least the resolution is wrong as I'm not seeing horizontal scaling artifacts in the game and they run at full screen in the 352 pixel wide resolution mode. So again I'm thinking the resolution is at least 352x224.

TrekkiesUnite118
5th January 2020, 09:38
So I've still been tinkering around with this, so I figured I'd post an update on what little info I've found. I'm still not sure what format these videos are in. I'm pretty convinced though that the Quicktime Headers aren't really accurate. For one it doesn't seem like the Game code is actually reading any of it when it's decoding the video, and the data there just doesn't match what I'm seeing in RAM.

The video resolution at least appears to be 352x176 from what I'm seeing in VRAM:
https://i.imgur.com/ni5dmpz.png

In Work RAM I'm seeing this while the decoding is going on:
https://i.imgur.com/c8vEmjB.png

I'm not that familiar with decoding algorithms, but it kind of looks MPEG-like? However I don't think it's CRI Sofdec as it doesn't look like any Sofdec file I've seen. Looking at the few Saturn games that use Sofdec I'm not seeing anything in HRAM that resembles what I'm seeing with Grandia. Again if anyone has any suggestions or ideas I'd greatly appreciate the help.