FINAL FANTASY XIII

FINAL FANTASY XIII

View Stats:
Lulech93 Dec 11, 2017 @ 8:43pm
I have successfully converted PS3 cutscenes to PC!
Seems a bit late at this point, but better late than never, right? To my knowledge no one else has managed to get PS3 cutscenes for FFXIII running in the PC version--which, honestly, is a bit surprising, now that I've figured out how it's done for myself.

As everyone probably knows, the PC version of FFXIII ships with cutscenes of lower quality than the PS3 release, which uses the lowest compression of any edition of the game. Also as everyone probably knows, you can't just drop the PS3 cutscene files into the PC version of the game and expect them to work.

At first glance, this can be a bit puzzling, considering the format appears to be the same. For example, the opening intro is named "z000_us.win32.wmp" on PC and "z000_us.ps3.wmp" on PS3. Just change "ps3" to "win32" and it should be the same, right?

Well, no, actually, they're not the same at all. A quick hex edit will reveal that the PC cutscenes are secretly encoded as Bink 2 videos, while the PS3 cutscenes are secretly (what I believe is) a proprietary Sony container called PAM. The video portion of these PAM files is essentially your standard MPEG, but audio is encoded in ATRAC. This we can determine by the "KB2i" (Bink 2) and "PAMF0041" (PAM) in the headers for each file.

For example: https://i.imgur.com/hFY5oiN.png

Now, even though both of these are known formats, try any media player you like and it'll most likely fail to read them. This is because Square Enix has added a 16-byte header of their own identifying the video as a WMP file even though, in this case, the WMP format is completely fictional. On the PC, simply removing these first 16 bytes is all it takes for the video to be recognized by RAD Video Tools as a Bink 2 video. Since the PS3 version is essentially a fake format within a fake format, you have to go a bit further and delete the first 800 bytes instead, leaving just an MPEG file behind.

Now, at this point either file should play back in media players like MPC or VLC just fine. But to get the PS3 cutscenes into the PC version of the game, we need to convert them to Bink video, and RAD Video Tools doesn't seem to like hex edited PS3 cutscenes as they are. Plus, extracting the audio from the PS3 cutscenes is a bit harder, and so by default the video will be silent. Yet another problem is that the PC version of the game has cutscenes stored at 1280x736 (why?) and the PS3 version at 1280x720 (that's better). Running 720p cutscenes in the PC version works, but for some reason only the blue color channel is scaled to fullscreen while red and green are displayed at 1x resolution.

To solve all of these issues, I used FFMPEG to first extract the audio from the PC cutscenes and then combine them with the PS3 cutscenes into AVI files using MPEG4 and MP3 for video and audio, respectively. While I was at it, I also told FFMPEG to scale up the PS3 cutscenes to 1280x736. At last, the resulting files can be read by RAD Video Tools and from there converted to Bink (Bink or Bink 2 doesn't matter, and Bink 2 requires a license, so I stuck with Bink 1).

The last step was to hex edit the final Bink file and add back in the 16-byte WMP header that I had deleted earlier. After that, it really was just a matter of renaming "z000_us.ps3.wmp" to "z000_us.win32.wmp" and sticking it in my FINAL FANTASY XIII\white_data\movie folder!

Unfortunately, Bink 1 is not that great a format, and it's difficult to complete this transition without some loss of quality. Still playing around with things on that front. However, the PS3 cutscenes have distinctly better color regardless, and with FFMPEG it's also possible to interpolate the cutscenes to 60 FPS to better match PC gameplay.

All in all, I had quite a fun time exploring these files and coming up with a solution to a three year-old problem. Eventually, my work here will be implemented as a conversion profile in Vidsquish, a tool I created to automate the process of modifying game cutscenes to better suit your exprience. So if better cutscenes interests you, but hex editing doesn't, keep your eyes peeled on the Vidsquish group page!

www.steamcommunity.com/sharedfiles/filedetails/?id=890543121

UPDATE 1/14/18 - I have now managed to identify and extract audio streams from the PS3 cutscenes... I think. There are seven channels for surround sound, but they're not quite the format I was expecting and so far nothing I've thrown them at has been able to play them. This means they're either a) a variant of ATRAC3 which is even less well-known than ATRAC3, and/or b) I'm not identifying the streams correctly and extracting the wrong bytes.

However, I can confirm that the PC audio is four-channel surround, so while not quite as good as the PS3, it's not a horrible downgrade. Most likely it'll be easier to find a way to preserve the original PC audio quality than to find a workable solution for PS3 audio at this point.

UPDATE 1/17/18 - It's official: Vidsquish now supports converting PS3 cutscenes to PC automatically! Check out the Steam group linked above!
Last edited by Lulech93; Jan 17, 2018 @ 7:49pm
< >
Showing 1-15 of 44 comments
NijiBashira Dec 11, 2017 @ 10:52pm 
That's really cool ! Impressive work !
Kain Dec 12, 2017 @ 6:29am 
Great work, buddy!
Tallcat Dec 31, 2017 @ 12:54am 
Wow. That's pretty awesome.
Marrow Dec 31, 2017 @ 1:39am 
lol, so it was all about a stupid useless header...
Kasha Dec 31, 2017 @ 2:53am 
Sweet!
MegaApple Dec 31, 2017 @ 3:44am 
Thank you for your hard work.
enderandrew Dec 31, 2017 @ 10:04am 
Can you release a tool to help others do the same?
Lulech93 Dec 31, 2017 @ 12:33pm 
Originally posted by enderandrew:
Can you release a tool to help others do the same?

Working on it! Keep an eye on the Vidsquish page linked in the OP. I plan on including FFXIII profiles when the new version of the program is released.
Lulech93 Dec 31, 2017 @ 1:54pm 
Originally posted by TheGhostFreak21:
Sweet! :) I wonder for the audio, can we just record the audio for PS3 cutscenes using a capture card and import them into the coverted videos?

I'd just use the audio from the PC cutscenes. It sounds fine and matches up perfectly with the PS3 cutscenes as far as timing is concerned. Also easier to automate that way. Most likely how it'll work is that you drop your PS3 cutscenes into the same folder as the PC cutscenes, PC cutscene audio is extracted, PS3 cutscenes are converted, and then both are packaged into replacement PC versions.
SmartScrew Dec 31, 2017 @ 7:56pm 
Thanks for existing.
5chneemensch Jan 1, 2018 @ 10:39am 
Thanks! I wanted to replay the game, guess I'll hold off till the end of january (your estimated release date on reddit).
SweatyThighs Jan 1, 2018 @ 4:04pm 
Awesome
Jadentheman Jan 4, 2018 @ 7:10pm 
Originally posted by Lulech23:
Originally posted by TheGhostFreak21:
Sweet! :) I wonder for the audio, can we just record the audio for PS3 cutscenes using a capture card and import them into the coverted videos?

I'd just use the audio from the PC cutscenes. It sounds fine and matches up perfectly with the PS3 cutscenes as far as timing is concerned. Also easier to automate that way. Most likely how it'll work is that you drop your PS3 cutscenes into the same folder as the PC cutscenes, PC cutscene audio is extracted, PS3 cutscenes are converted, and then both are packaged into replacement PC versions.

But the PS3 cutscnes have 5 channels in it's audio compared to the PC just being 2 channels. Unless I'm mistaken
Lulech93 Jan 4, 2018 @ 7:24pm 
Originally posted by Jadentheman:
But the PS3 cutscnes have 5 channels in it's audio compared to the PC just being 2 channels. Unless I'm mistaken

PC is also 5-channel IIRC. I'm away from my PC atm, but I do recall seeing multiple channels last I checked.
Briggs Jan 11, 2018 @ 2:53pm 
Amazing. I was coming here specificly to see if the low rez CS were fixed. Now I know that they aren't, but someone has done Square's job for them. Thanks!
< >
Showing 1-15 of 44 comments
Per page: 1530 50