A guide on how to fix stutter, extract, and edit P4G cutscenes in Persona 4 Golden.
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). Some files go much higher (>30Mbps) which causes stuttering for some users on slower drives!
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. Unp4cker handles this by padding smaller files to match their originals, but larger files will require deeper modification.
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.
What’s New?
- Modified files will now be automatically padded to match the filesize of their originals. This means files less than (or equal to) the originals are now supported!
- A warning will now be displayed for files larger than the originals
- Fixed files being repacked out of order
- General improvements to code
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 and archive require 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” folder and replace the existing archive (it is highly recommended to make a backup first).
Now launch the game and enjoy the classic intro!
Example: Fix Stutter
Some users may experience stutter during certain cutscenes due to the wildly varying bitrate between video files. While most stay within a reasonable range (~8Mbps), some go as high as 30Mbps and more! This should pose no problem for a fast SSD, but slower hard drives and other storage mediums may struggle to read the video file fast enough to keep up.
By re-encoding the video to a lower bitrate, we can solve the stuttering problem once and for all!
To start, unpack the archive with the video giving you trouble. In this example, we’ll be using the Golden intro, which is contained within “movie00002.pac”:
- .\unp4cker.ps1 “S:\SteamLibrary\SteamApps\common\Day\movie00002.pac”
Next, navigate to the newly-created “movie00002” folder next to Unp4cker. Here you’ll find four files, with “3.wmv” being the English intro.
Now, to re-encode the video file, we’ll need a conversion application. There are many available which support WMV, but for this example, we’ll be using the free and open-source FFMPEG.
FFMPEG is a very powerful command-line video encoding utility we can use right within PowerShell:
- C:\path\to\ffmpeg.exe -i “C:\path\to\unp4cker\movie00002\3.wmv” -c:v wmv2 -b:v 8M -c:a copy -map 0 “C:\path\to\unp4cker\movie00002\3_copy.wmv”
This command will re-encode the video at 8Mbps, putting it on-par with the other videos. Audio will be left unmodified (and crucially, all language streams will be preserved).
When FFMPEG is finished, simply delete the original file and rename the copy to the original filename. Then repack with the command:
- .\unp4cker.ps1 “S:\SteamLibrary\SteamApps\common\Day\movie00002.pac” –pack .\movie00002
Finally, copy the packed archive back to your “..\SteamLibrary\SteamApps\common\Day” folder and overwrite the original (make sure you have a backup first!).
From now on, your video playback will be smooth as silk!
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 LESS THAN or equal to the size of the original files, 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 larger file sizes will crash the game (with the exception of the last file in each archive).
By Lulech23
Similar Posts:
- Persona 4 Golden – How to Fix Intro (PS2 Mod)
- Persona 4 Golden (PC) – How to Store and Mod Soundtracks (Rebuilding, Extracting)
- Persona 4 Golden (PC) – How to Find and Replace or Delete Save File
- Persona 4 Golden – How to Transfer Vita Saves to PC
- Persona 4 Golden – How to Fix Cutscenes (Temporary Opening & Lag)
- Persona 4 Golden – Useful Tips for Rank, Adachi, Marie, Golden End Requirements
- Persona 4 Golden – How to Get Subtitles In Cutscenes
- Persona 4 Golden – Best Difficulty PC Settings (How to Change) and Soundtracks
- Persona 4 Golden – How to Unlock the Secret Boss and Achievement
- Persona 4 Golden – True Golden Ending Walkthrough
- Persona 4 Golden – Leveling Up and Making Money (Best-Fast Method)
- Persona 4 Golden – All Side Quests 1 (Mysterious Fox, Inaba)
- Persona 4 Golden – List of Numbers (Using on a Certain Site)
- Persona 4 Golden – All Side Quests 2 (Yukiko’s Castle, Striptease, Void, Heaven, Secret, Bonus)
- Persona 4 Golden – How to Beat Boss (Secret) and True Ending