Persona 4 Golden: Extract and Edit Cutscenes with Unp4cker

Use a custom PowerShell script to extract P4G cutscenes for modification and repackage them into the game!

 

Introduction


Unp4cker is a PowerShell script which uses GNU CoreUtils to automatically identify and extract P4G PC video files. It can also repackage them for in-game playback, although this feature is currently experimental.

File Format Breakdown

Persona 4 Golden cutscenes on PC are quite different from their PlayStation Vita counterparts. Vita used plain MP4 files in a simple folder, whereas the PC version has them packed into archives. These archives essentially smash a bunch of video files together into one big file with some extra data at the beginning to tell the game where to find each video.

On PC, P4G cutscenes are encoded in WMV2 (likely to avoid MP4 licensing fees) at 1920×1080, using some sort of upscaling filter to smooth out the 960×544 Vita originals. Despite Windows reporting they’re encoded at just ~200Kbps and 15FPS, the encoder was allowed to go much higher and real-world results land at ~8Mbps and 29.97FPS (pretty much standard for 1080p).

There’s 41 cutscenes total split across three archives:

movie00000.pac movie00001.pac movie00002.pac
Unp4cker Methodology Breakdown

Unp4cker works by searching these archives for WMV2 byte headers and then splitting them out to individual .wmv files. Doing the reverse is also possible, but with one big caveat: currently, any modified files must be exactly the same size down to the byte, otherwise the game will not be able to locate any files that come after them.

Naturally, this does not apply to the last file in any archive, which means that incidentally the English intro video can safely be replaced with the PS2 original, since it is the last file in the last archive.

Download

Latest Version
Previous Versions
  • N/A

How-To


Unp4cker is a PowerShell script, and requires certain arguments to operate. But don’t worry if you’re not used to command-line: it’s simple!

1. Extract

First, download Unp4cker and extract the .zip file contents anywhere on your PC. Temp files will be located next to the script, so make sure you have write permissions on a drive with at least a few GB free.

2. Open PowerShell

If you don’t use it often, you may be surprised to find that Windows 10 has a variety of convenient ways to open PowerShell right where you want it! Any of the following methods will do just fine:

  • In the file explorer window where you’ve extracted Unp4cker, choose File > Open Windows PowerShell
  • In the file explorer window where you’ve extracted Unp4cker, hold Shift and right-click in a blank space, then choose “Open PowerShell window here”.
  • Open the Start menu and start typing “PowerShell” to search for it. Run it, and in the PowerShell window, enter:
    cd “C:\path\to\unp4cker”

    (The “cd” command stands for “change directory”.)

2.5. Enable PowerShell script execution

By default, PowerShell disallows running any custom scripts to protect against malicious scripts. If you’ve never used PowerShell scripts before, you’ll need to enable them in one of two ways:

  • Open the Windows Settings app and navigate to Update & Security > For Developers. Scroll down to the PowerShell section and check the box “Change execution policy to allow local PowerShell scripts to run without signing.”
  • Open another PowerShell window as Administrator and run the command:
    Set-ExecutionPolicy -Scope “CurrentUser” -ExecutionPolicy “Unrestricted”

    (You can close this window when complete.)

3. Unpack a file with Unp4cker

With PowerShell open and the current directory set to the unp4cker folder, you’re ready to start issuing commands!

To unpack a file with Unp4acker, simply type the script file followed by the path to a movie archive in your Persona 4 Golden Steam library:

.\unp4cker.ps1 S:\SteamLibrary\SteamApps\common\Day\movie00002.pac

Note: The “.\” tells PowerShell to look for Unp4cker in the current directory. If you start typing “unp4cker” and press Tab, it will autocomplete this part for you.

Movie files will be extracted to a folder next to Unp4cker with the same name as the archive.

4. Repack a file with Unp4cker

Once you’ve made any modifications to the extracted files, you can repack them again into a new archive for use with P4G.

Warning: This feature is experimental and may not work as expected. Always back up original archives first!

Repacking an archive requires all files from the original archive to be present in the extracted folder. It is not currently possible to replace an individual file.

In other words, the number of files in the folder to repack must equal the number of files in the original archive.

To pack a file with Unp4cker, you will need to input two paths: 1) the path of the original archive, and 2) the path of the folder containing files to pack. The second path must be preceded by the “–pack” command to indicate the path is a source folder.

For example:

.\unp4cker.ps1 S:\SteamLibrary\SteamApps\common\Day\movie00002.pac –pack C:\unp4cker\extracted\movie00002

This will create a new version of the archive in an “out” folder next to Unp4cker. Copy it into your P4G Steam library and replace the original (make sure you have a backup first!), then run the game to see the results!

Example: Replace Golden intro with PS2 intro


A simple modification with Unp4cker you may be interested in is replacing the remade Golden intro with the classic PS2 intro. This intro was included with P4G as an unlockable bonus, but can be copied in place of the updated intro as well.

First, unpack the archive “movie00002.pac” from your Steam library’s “..\SteamApps\common\Day” folder:

.\unp4cker.ps1 S:\SteamLibrary\SteamApps\common\Day\movie00002.pac

Next, open the newly-created “movie00002” folder next to Unp4cker in your file explorer. You’ll find four files, named “0-3.wmv”. The last one, “3.wmv” is the English Golden intro, while “1.wmv” is the classic PS2 intro.

Delete “3.wmv”, then make a copy of “1.wmv” and rename it to “3.wmv”.

Important! Do not simply rename “1.wmv”! In the end, there MUST still be four files total.

With the Golden intro replaced, it’s time to repack the folder into an archive!

.\unp4cker.ps1 S:\SteamLibrary\SteamApps\common\Day\movie00002.pac –pack .\movie00002

This will create a new “movie00002.pac” archive under the “out” folder next to Unp4cker. Copy the repacked archive to your Steam library’s “..\SteamApps\common\Day” and replace the existing archive (it is highly recommended to make a backup first).

Now launch the game and enjoy the classic intro!

Known Issues


Unp4cker is an experimental file modification script, and comes without guarantee, warranty, or support. While it has been tested and found to be generally reliable, please keep in mind the following known issues and caveats when using it:

  • When repacking, all files must be the EXACT same size, down to the exact byte, otherwise the game will not be able to read any cutscenes following the mismatched cutscene in the same archive. Attempting to play modified archives with different file sizes will crash the game.

    (Naturally, this excludes the last file in an archive, which incidentally makes replacing the intro perfectly safe.)

    • Smaller files may be possible with an update to the script to pad out the difference between the modified and original file.

By Lulech23

Related Posts:

Post Author: Robins Chew

Leave a Reply

Your email address will not be published. Required fields are marked *