davisdude / slp2mp4

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

slp to mp4

slp2mp4 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

Setup

First, install python. Make sure you have at least Python 3.7 installed. While installing, be sure to check that pip should be installed as well, and that Python should be added to your environment variables.

Now, in a command window, run the following command:

pip install git+https://github.com/davisdude/slp2mp4

The same command can be used to update to the latest version at any time. Note that this will reset all settings.

Usage

usage: slp2mp4 run [-h] [-o dir] path [path ...]

positional arguments:
  path                  Slippi files/directories containing slippi files to convert

options:
  -h, --help            show this help message and exit
  -o dir, --output_directory dir
                        Directory to put created mp4s

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

Event/
      a.slp
      b.slp
      c.slp
      Game_1/
             d.slp
             e.slp
             f.slp
      Game_2/
             g.slp
             h.slp
             i.slp

gives

./OUTDIR/Event.mp4
./OUTDIR/Event-Game_1.mp4
./OUTDIR/Event-Game_2.mp4

Where ./ is the directory in which the command was run and OUTDIR is the (optional) prefix given if you want all videos to show up in a specific spot. Additionally, Event.mp4 is made up of a.slp, b.slp, and c.slp, Event-Game_1.mp4 is made up of d.slp, e.slp, and f.slp, and so on.


Configuration

To enter configuration mode, run

slp2mp4 config

NOTE: Unfortunately, you will need to redo the configuration each time you update.

From here, you will see several fields (described below), which you can configure by entering text and hitting enter.

There are several configuration options that you can control:

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