NunoDasNeves / slp-to-mp4

Convert slippi replay files for Super Smash Bros Melee to videos
MIT License
46 stars 10 forks source link

slp to mp4

slp-to-mp4 converts Project Slippi replay files for Super Smash Bros. Melee to mp4 videos.

The goal is to make it easy to batch-convert replays to HD video without screen recording software.

Dependencies

A Super Smash Bros. Melee v1.02 NTSC ISO.

Setup

Install the above dependencies to your machine.

Linux

Modify the paths in config.json to point to your Melee ISO, ffmpeg binary and the directory of the playback instance of Dolphin.

Windows

Modify the paths in config_windows.json to point to your Melee ISO, ffmpeg binary and the directory of the playback instance of Dolphin.

Usage

slp-to-mp4.py REPLAY_FILE [OUTPUT_FILE_OR_DIRECTORY]

or

slp-to-mp4.py DIRECTORY_WITH_SLP_REPLAYS

This launches Dolphin, which plays the replay and dumps frames and audio.
Then ffmpeg is invoked to combine audio and video.


If recording one replay file with no output file specified, the video file with the same name will be placed in slp2mp4/out.


If recording a directory and not combining, the individual games will be placed in a subfolder in slp2mp4/out/ with the .slp parent folder's name. Example:

Name_Of_Event/Game_1234.slp
Name_Of_Event/Set_A/Game_1234.slp
Name_Of_Event/Set_A/Game_1235.slp

gives

slp2mp4/out/Name_Of_Event/Game_1234.mp4
slp2mp4/out/Set_A/Game_1234.mp4
slp2mp4/out/Set_A/Game_1235.mp4

If recording a directory and combining, one video will be created in slp2mp4/out/ for each subdirectory with the .slp parent folder's name. Example:

Name_Of_Event/Game_1234.slp
Name_Of_Event/Set_A/Game_1234.slp
Name_Of_Event/Set_A/Game_1235.slp

gives

slp2mp4/out/Name_Of_Event.mp4
slp2mp4/out/Set_A.mp4

Configuration

For linux, the configuration file is config.json. For Windows, the file is config_windows.json.

Performance

Resolution, widescreen, bitrate, and the number of parallel games will all affect performance. Dolphin will not record well (skips additional frames) when running less than or greater than 60 FPS. It becomes noticeable below 58 FPS. YouTube requires a resolution of at least 720p to upload a 60 FPS video, so it should be a goal to run at that resolution or higher. A higher bitrate will come with better video quality but larger file size and worse performance because dolphin has more to encode. The number of parallel games will have the largest effect on performance. The 'recommended' value is the number of physical cpu cores, but greater or fewer parallel games may be optimal.

Future work