This PR adds the ability to record game sessions as raw a/v media files.
This feature can be toggled by the recording.enabled param. If it's enabled, you will see an additional text field with a button in the UI. The text field allows adding an arbitrary username (or just a tag) to the recording filenames on the server. The recording button just turns on or off the recording. In case if you want to record your game session from the start, you should activate the button before you start a game. The button has a recording indicator: grey -- not active, red -- active, blinking red -- recording. Each recording should have a unique name (by default it will) so it can be used with multiple workers.
By default, the recorder will produce three types of files in the configured directory:
raw PCM audio in the RIFF WAV container with the native sampling rate of an emulator
a list of video frames captured with the native framerate of an emulator compressed losslessly with PNG
an additional FFMPEG Concat demux file (input.txt) which will contain some export info, such as date, fps, sample rate, exported frame filenames, nominal and estimated frame render times.
It is assumed that raw a/v streams should be muxed with an external tool like FFMPEG or GStreamer.
When a recording session is stopped or finished, the whole output directory will be compressed with ZIP and then deleted.
There is a list of new configuration params:
recording:
enabled: false
# image compression level:
# 0 - default compression
# -1 - no compression
# -2 - best speed
# -3 - best compression
compressLevel: 0
# name contains the name of the recording dir (or zip)
# format:
# %date:go_time_format% -- refer: https://go.dev/src/time/format.go
# %user% -- user name who started the recording
# %game% -- game name (game ROM name)
# %rand:len% -- a random string of given length
# as example: 20210101101010_yeE_user1_badApple
name: "%date:20060102150405%_%rand:3%_%user%_%game%"
# save directory
folder: ./recording
Considerations
this feature is not supposed and not tested for working in the multiplayer mode (several players in one game room)
normally deviations in the frame rendering times will result in a visual speed up of the recording playback for these parts after the final mixing, but a possible fix will require some non-trivial logic for a/v stretching or shrinking in order to compensate that
This PR adds the ability to record game sessions as raw a/v media files. This feature can be toggled by the
recording.enabled
param. If it's enabled, you will see an additional text field with a button in the UI. The text field allows adding an arbitrary username (or just a tag) to the recording filenames on the server. The recording button just turns on or off the recording. In case if you want to record your game session from the start, you should activate the button before you start a game. The button has a recording indicator: grey -- not active, red -- active, blinking red -- recording. Each recording should have a unique name (by default it will) so it can be used with multiple workers.By default, the recorder will produce three types of files in the configured directory:
input.txt
) which will contain some export info, such as date, fps, sample rate, exported frame filenames, nominal and estimated frame render times. It is assumed that raw a/v streams should be muxed with an external tool like FFMPEG or GStreamer.When a recording session is stopped or finished, the whole output directory will be compressed with ZIP and then deleted.
There is a list of new configuration params:
Considerations