How-to guide: Recording Live Gameplay in RetroPie’s RetroArch Emulators Natively on the Raspberry Pi (and Twitch streaming)
-
I completely forgot to mention; the --record option ended up crashing altogether.
-
@LSolrac2 can you post your
emulators.cfg
for whichever emulator you're trying to record from?If you're using a custom
config.cfg
to control the ffmpeg recording format, can you post this?Also, can you double-check the paths and that there are no case-sensitivity issues in directory or file names?
Have you checked in /tmp/ for any
runcommand.log
file? - this often reveals the cause of recording problems -
Nice! Now I can stream to Twitch sometime soon!
-
@RetroPieNerd that's still an aspect I haven't got sorted, but I do return to it on occasion - perhaps under retroarch 1.3.6 it'll start working (I suspect, though, that it's simply going to be a grind to determine the correct combination of config.cfg settings)
-
@RetroResolution
Sure thing: http://pastebin.com/k8xg99Fr
No Config.cfg as I haven't gotten there, yet.
and the runcommand.log is literally blank.cat /tmp/runcommand.log that is
-
@LSolrac2
[EDIT: I'm wrong. The spaces doesn't matter!]
You can't have spaces before and after the equal sign.So, the following line is invalid:
default = "lr-mgba"
You should use it:
default="lr-mgba"
-
@LSolrac2 thanks for the pastebin link; is this a collection of entries from more than one emulators.cfg file? A single emulators.cfg would have an entry for
default=..
Can you post your entire
emulators.cfg
for a single retroarch emulator?[Edit] sorry, didn't spot the
default
entry, I tend to leave mine at the end of the fileI haven't tried the gameboy advance emulators (at all, not just for recording), although I have used the following when recording: VCS, megadrive, 32X, SNES, PlayStation, fuse (zx spectrum), and a custom built Atari800, amongst others.
Any chance you could use any of these, so we can work from a 'known-good' baseline? Preferably, could you try the Atari VCS emulator, as it places relatively little demand on the system, and allows recording to the Pi's SD Card, without needing a custom config.cfg - basically taking everything back to bare-bones?
There is the possibility that something is amiss due to your system having been updated from 3.8 to 4 rc-1, but let's hope not...
-
@meleu good spot meleu - hopefully this is all it is (there's me burrowing down deep, missing the obvious!)
[Edit] regardless, I'll add this to the guide, as it's definitely likely to trip people up
-
@LSolrac2 I noticed that thethe recording filename in your
emulators.cfg
has an extension of.mp4
, whereas I always use.mkv
; I don't' know if this is an issue, but I transcode from .mkv to .mp4 after recording. -
@RetroResolution just for reference, from the guide, here's the
emulators.cfg
from my system for the VCS emulator, Stellalr-stella="/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-stella/stella_libretro.so --config /opt/retropie/configs/atari2600/retroarch.cfg %ROM%" lr-stella-record-hdd-noconfig="/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-stella/stella_libretro.so --record /media/pi/EXT_HDD/RPi_AVI/recording_VCS.mkv --config /opt/retropie/configs/atari2600/retroarch.cfg %ROM%" lr-stella-record-hdd="/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-stella/stella_libretro.so --record /media/pi/EXT_HDD/RPi_AVI/recording_VCS.mkv --recordconfig /home/pi/RetroPie/recording/config/config.cfg --config /opt/retropie/configs/atari2600/retroarch.cfg %ROM%" default="lr-stella-record-hdd" stella="stella -maxres 320x240 %ROM%"
-
@RetroResolution
That's the GBA emulators one.
And guess what OuO It works for PSX just fine, just noticed a file created when I started it up the emulator. -
@LSolrac2 excellent!
It's possible it's simply an error in your GBA emulators.cfg then - or perhaps it doesn't work with that emulator (I found that the PC Engine emulator would only record sound, not video, for example) -
@RetroResolution
Taking newer notes such as the recordconfig and emulator specific recording, I've come to notice, lr-vba-next seems to work for recording GBA
However, when tested, I did NOT succeed in the shader passing, noted the specific case, just in case someone enjoys playing the game with Shaders (Like me and Sword of Mana) there wouldn't happen to be a way to load these up on a configuration, would there?PS Edit; no luck with ogg/libmp3lame, could be just typo, but libmp3lame crash, and ogg didn't record sound. (done via the recordconfig)
-
@LSolrac2 the only way I was able to record the output with shaders enabled was painfully slow; you need to update a setting in the retroarch.cfg to enable recording of the GPU framebuffer. I didn't include this in the guide as the frame rate is totally unplayable, even on the VCS emulator (playback is at full speed, however).
Just to show it does work though, here's footage I made of Space Harrier (32X). You can see me enabling the barrel distortion, and barrel distortion-with-phosphor shaders.
-
@RetroResolution
I'm not sure if you use your blog to monetize, but I think your tutorial is the kind of info that fits very well in RetroPie wiki... -
@meleu it's pretty much all done for the love of it!
-
@RetroResolution I enjoy your writing style. It's precise and detailed! ;-)
-
From tests it seems that sometime in the last few days some changes have been made to RetroArch 1.3.6; as well as adding a very funky new UI, when recording is enabled using FFmpeg something fails when the PlayStation emulator lr-pcsx-rearmed is used (as soon as runcommand starts the emulator segmentation faults are logged, and the system returns to Emulation Station). Recording from VCS, Megadrive, 32X, and SNES were all working as normal.
[Edit - the 'funky new UI' turned out to be an old interface which resurfaced due to a missing default value in the codebase - see @meleu 's post, below]
I have determined the steps required to pull a specific version of RetroArch from the Git archive (in this case 1.3.6 as released on 17th July), and have the existing RetroPie setup system build this (instead of the default behaviour of pulling the very latest source code).
I'll write this up as an addendum to my original guide, but for now the required process is:
OBTAIN AND BUILD SPECIFIC VERSION OF RETROARCH TO ENABLE FFMPEG RECORDING
[edit - updated 28th September 2016 - adding manual ./configure step due to minor change in build subsystem; adding
sudo
to various commands following change in permissions of temporary build directories; adding creation of temporary build directories]Modify the RetroPie setup script for RetroArch:
cd /home/pi/RetroPie-Setup
If the following directories are not already present:
sudo mkdir tmp
sudo mkdir tmp/build
remove parameter which is disabling ffmpeg in retroarch:
sed -i "s/--disable-ffmpeg//" scriptmodules/emulators/retroarch.sh
Edit the script to prevent call which obtains the very latest version of RetroArch source from git repository:
sed -i 's@\(gitPullOrClone "$md_build" https://github.com/libretro/RetroArch.git\)@#\1@' scriptmodules/emulators/retroarch.sh
Obtain RetroArch version 1.3.6 (as a tar) from the git archive:
cd /home/pi/RetroPie-Setup/tmp/build
sudo wget https://github.com/libretro/RetroArch/archive/v1.3.6.tar.gz
Unpack tar archive file:
sudo tar xzvf v1.3.6.tar.gz
Remove the tar file:
sudo rm v1.3.6.tar.gz
Rename directory to that expected by setup script:
sudo mv RetroArch-1.3.6/ retroarch
cd retroarch
Manually run the configuration script for RetroArch
sudo ./configure
Run the setup script to build RetroArch 1.3.6 with ffmpeg enabled:
cd /home/pi/RetroPie-Setup
sudo ./retropie_packages.sh retroarch
Replace the modified script file (to prevent issues when running future updates via the retropie setup script, due to uncommitted changes in the local git repository casused by modifying this file)
git checkout scriptmodules/emulators/retroarch.sh
NOTE:
after running the script, the temporary build folder should be empty
/home/pi/RetroPie-Setup/tmp/build
...and
/opt/retropie/emulators/retroarch
should contain the freshly rebuilt version 1.3.6 retroarch -
@RetroResolution this trick useful for testing bugs between versions. Thanks for sharing.
But the RetroArch user interface you mentioned is the xmb menu driver. You can explicitly get the "old" rgui back setting
menu_driver = "rgui"
.Cheers.
-
@meleu thanks Meleu. The UI regression threw me somewhat - I started a new thread when I first noticed problems; @dankcushions was on there along with others, and also talked about the UI options - thanks for mentioning it though.
Resolving the loss of recording using the PlayStation emulator was my main focus - it's the main reason I started the entire FFmpeg project in the first place!
[Edit - somehow it's two weeks later and I've not yet written this update into the main guide...]
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.