How-to guide: Recording Live Gameplay in RetroPie’s RetroArch Emulators Natively on the Raspberry Pi (and Twitch streaming)
-
Whilst running through the instructions on a fresh Raspbian Jessie Pixel build, and using the latest RetroPie, I noticed an incorrect path in my revised instructions (above) which build a specific version of RetroArch.
I've edited the relevant post, above. The corrected line is:
sed -i 's@\(gitPullOrClone "$md_build" https://github.com/libretro/RetroArch.git\)@#\1@' scriptmodules/emulators/retroarch.sh
Without the correct path, the original
sed
command fails, and thus the system would still fetch the latest source version of RetroArch, rather than the specific build of 1.3.6 as was intended.I'm still installing things, so I don't yet know if changes to Raspbian and/or RetroPie are causing problems for recording. Thus far ffmpeg compiles, which in itself is great news.
-
Well, the good news is that I was able to build RetroArch with FFmpeg recording enabled, and have seen in RGUI that under Settings/Driver the 'Record Driver' entry is 'ffmpeg'.
I haven't actually tested the recording, as I'll need to move some roms and bios files onto the new test system, and setup the emulator.cfg files, but it looks like it will work on the latest Raspbian and latest RetroPie.
For reasons I haven't yet determined, I cannot now build a specific version of RetroArch using the instructions I posted earlier in this thread (that said, the blog commenter which prompted the creation of that approach has subsequently confirmed that his installation works fine using the original approach, in which the RetroPie-Setup script fetches the latest RetroArch version from github)
For posterity, the error I get when attempting to build 1.3.6 of retroarch as released on July 17th is:
Checking operating system ... Linux Unknown option --enable-opengles Makefile:9: config.mk: No such file or directory rm -rf obj-unix rm -f retroarch rm -f *.d Makefile:9: config.mk: No such file or directory config.mk is outdated or non-existing. Run ./configure again. Makefile:128: recipe for target 'config.mk' failed make: *** [config.mk] Error 1 /home/pi/RetroPie-Setup Could not successfully build RetroArch - frontend to the libretro emulator cores - required by all lr-* emulators (/home/pi/RetroPie-Setup/tmp/build/retroarch/retroarch not found).
It seems to me that the owner and permissions of the /tmp/build directories which the setup script creates beneath /home/pi/retropie-setup have changed - I believe they were both 'Pi' on my previous installations, but are now 'root'.
Regarding the error 'unknown option --enable-opengles', this is on the same line as the 'disable--fmpeg' command which the SED instruction removes, however I've checked that this works cleanly, and also manually excised the instruction, but with no success.
I'm wondering if you have any insights @meleu ? - you seem to be pretty hot on this stuff!
-
@RetroResolution I did run into that error as well earlier. After running ./configure manually and re-running the script it did rebuild retroarch but I still had the ffmpeg issue.
The good news is after recompiling ffmpeg and then pulling down a fresh latest copy of retropie, ffmpeg is now showing as enabled!
Thanks for your help!
-
@shaun040 that's great news, I'm glad recording is working for you.
I'm determined to work out why building a specific release of retroarch is no longer working - I suspect it's a change in RetroPie's build scripts, but just in case, could you let me know if your system was built on the new Raspbian image (with the Pixel desktop theme)?
-
I built it it on Raspian Lite - file name is 2016-05-27-raspbian-jessie-lite.img
I see that there is a newer version so I must have downloaded this one a day or 2 prior to the 9/23/2016 release being put up to download.
-
@shaun040 hi,
Thanks for this information, I appreciate it - that's also good news in that it eliminates the latest Raspbian as the issue regarding building a specific RetroArch version (I suspected as such - after all it can compile all of ffmpeg and assorted codecs).
Thanks also for noting that you were able to compile the July 17th build of retroarch 1.3.6 after manually running ./configure - that's where I got to last night (but I didn't actually do that, it was getting late!)
-
Further to yesterday's posts regarding problems with the custom build of RetoArch, it appears that some changes in the current/latest RetroPie build system have necessitated slightly revised steps to obtain and compile the specific RetroArch 1.3.6 build as released on 17th July.
I've edited the earlier post in which the steps are detailed, adding the creation of a couple of temporary directories, adding
sudo
to a few commands, and running the retroarch./configure
manually.As noted yesterday, it should only be necessary to run through these additional steps if an overnight build of RetroArch happens to conflict in some manner - normally the simpler approach to rebuilding RetroArch, as covered in the main guide, will suffice.
-
@RetroResolution just to finish off the updates from yesterday and today, I've just successfully tested recording from the following RetroArch emulators:
PlayStation (lr-pcsx-reamred),
VCS (lr-stella),
Megadrive (lr-picodrive).These tests were made on a fresh install of Raspbian Jessie with Pixel (Image 2016-09-23), with the latest RetroPie installed on top (4.0.3) as per my guide:
-
This is a great guide. I followed it last night and got gameplay recording working on my RetroPie with only a few hiccups. I've blogged about my experience and the steps I took (which are basically RetroResolution's steps) here: How To Record A GamePlay Video From A RetroPie
Personally I think that this would make a great default addition to RetroPie in the future.
-
@selsine Cheers selsine, that's great to hear. I've responded to your comments on my blog as well (sorry for the delay in replying). Thanks
-
I've still not got around to revisiting the issue of getting Streaming to Twitch working, however this weekend a user posted a couple of links in the comments section of my blog post for the guide; in their linked article they use ffmpeg to stream from the Pi, albeit not from within RetroArch. I feel sure there's a way to combine all the available information and get this working!
-
@RetroResolution I actually got Twitch streaming working today and wrote a quick blog post about it: How To Live Stream To Twitch from a RetroPie
I ended up using the following FFmpeg settings, 'libmp3lame' caused a bus error and would crash so I switched to 'aac':
vcodec = libx264 acodec = libfdk_aac pix_fmt = yuv420p threads = 2 scale_factor = 1 format = flv video_preset = ultrafast video_profile = baseline video_tune = animation video_level = 1.2 sample_rate = 44100 audio_preset = aac_he_v2
I'm still trying to figure out the FFmpeg settings because what is available in the config file doesn't seem to match what the FFmpeg documentation has 100%. I'm assuming that some translation is happening but I'm not sure.
Maybe someone who knows FFmpeg really well can point us in the right direction.
If it's up my Twitch stream is here:
-
@selsine said in How-to guide: Recording Live Gameplay in RetroPie’s RetroArch Emulators Natively on the Raspberry Pi (and Twitch streaming):
The following config settings seem to be working much better than my previous settings:
vcodec = libx264 acodec = libfdk_aac pix_fmt = yuv420p threads = 2 scale_factor = 1 format = flv video_preset = ultrafast video_profile = main video_tune = animation video_bufsize = 512k video_minrate = 512k video_maxrate = 512k video_r = 60 video_g = 120 video_keyint_min = 60 sample_rate = 44100 audio_preset = aac_he_v2 audio_global_quality = 1
-
How about Youtube streaming? Is it possible?
-
@Rion said in How-to guide: Recording Live Gameplay in RetroPie’s RetroArch Emulators Natively on the Raspberry Pi (and Twitch streaming):
How about Youtube streaming? Is it possible?
Yup, I wrote up a quick guide: How To Live Stream To YouTube from a RetroPie
It's the same thing as streaming to twitch except you use the YouTube RTMP URL and your YouTube stream key.
I've noticed that the performance on the YouTube live stream isn't as good as the twitch stream, so the FFmpeg settings probably need to be tweaked.
-
Great work on the guide, thank you very much! Using scale_factor on the cfg to double the resolution really ramps up the CPU usage to make it impossible! I found a way to make it work and failed to get a recording thus far though.
Raspberry Pi 3 has an integrated hardware encoder, dubbed h264_omx and to use it you need to compile ffmpeg with these added:
–enable-omx
–enable-omx-rpi
–enable-mmalI compiled FFMPEG with these, but when I choose h264_omx as my encoder it results in an empty recording. What am I doing wrong?
Also, most encoders and formats do not work, which is really super weird.
By the way, if this works as intended, the hardware encoder can do live transcoded 720p livestreams or recordings with no sweat. I've seen a person use a raspberry pi 2 as a transcoding PC through nginx-rtmp to stream to Twitch.
-
Hi all,
I've managed to get gameplay recording working for PSX after following the great guides BUT I have hit a bit of a snag. Some PSX games record OK at first when you launch it so the intro, menus etc record OK, but as soon as you get in to the actual game the screen goes black and I can only hear sound. What have I done wrong?
I tested 3 PSX games:
Retropie 4.1
Retroarch 1.3.6Alexi Lalas International Soccer [See video below]
Lone Soldier
Doom (worked OK with no issues ??)
These are both using my config.cfg file which is as follows:
format = matroska
threads = 3
vcodec = libx264rgb
video_preset = ultrafast
video_tune = animation
pix_fmt = bgr24
video_qp = 0
acodec = flacCould it be an NTSC/PAL related problem?
Any ideas?
Thanks!
-
@RetroResolution , hi!
First of all, thank you for the rich tutorial! Besides I haven't accomplished to start the recordings, I think I will get there.
I am new to Retropie, but I could understand almost everything you told about this process.
I have a Raspberry Pi 3 running Retropie (fresh 4.1 installation) . I Did not install over an existing Raspbian, but instead, I've burned a Retropie 4.1.
RetroArch version is 1.3.6.I have succeeded the FFmpeg installation (used your script).
But, on the step:
"Rebuilding RetroArch to Enable FFmpeg Recording"
after following your instructions with the script:
#remove the config that disables ffmpeg on the RPI
sed -i "s/--disable-ffmpeg//" scriptmodules/emulators/retroarch.sh
#build new retroarch from source
sudo ./retropie_packages.sh retroarch
#put the file back how it was
git checkout scriptmodules/emulators/retroarch.shI 've got this:
I've tried to find the ffmpeg driver on settings menu ( I'm using Retroach 1.3.6)
but it still shows 'null'.Well, I've read your new considerations about "OBTAIN AND BUILD SPECIFIC VERSION OF RETROARCH TO ENABLE FFMPEG RECORDING".
I repeated all command line procedures as suggested by you and in the end I've got to this:
What am I doing wrong? Sorry for the long post, but I believe this is a feedback to you, as new releases come always with issues!Thank you!
Filipe
-
I compiled FFMPEG with these, but when I choose h264_omx as my encoder it results in an empty recording. What am I doing wrong?
Does anything show up in your /dev/shm/runcommand.log logfile when you try to use h264_omx?
-
Hey all!
I just want to say that I made it! I have flawless videos recordings from SNES!
But, as a feedback, I will put something I realized after trying different things.
First, as I posted before, I was trying to follow all procedures as described by the rich tutorial written by @RetroResolution - Recording Live Gameplay in RetroPie’s RetroArch Emulators Natively on the Raspberry Pi .
I was using a fresh Retropie 4.1 installation. As I told on the previous post, I've failed to rebuild Retroarch.
So, I decided to install the last version of Raspbian Jessie Light (without Pixel).
Then, I first installed FFmpeg using the All in One Script ( thanks again, @RetroResolution!) and tested it, confirming it was working properly.
I have manually installed and configured Retropie and, after using the few steps first described in the tutorial:
"OBTAIN AND BUILD SPECIFIC VERSION OF RETROARCH TO ENABLE FFMPEG RECORDING".
I still could not succeed!!!
Well, I got really intrigued with this persistent issue: fail to apply pach when running retroarch.sh during the rebuilding procedure...
So, as a last try, I went to the little tutorial posted by @selsine (thanks for that: How To Record A GamePlay Video From A RetroPie) because you put something important there:
"And finally execute it, but NOT as root:
$ . /home/pi/tools/build-retroarch-with-ffmpeg.sh"
And suddenly, Retroarch is rebuilt!
Well, I don't know if it has something to do with the permissions (ownership) but it did run.
Now, I am just testing some configurations, but it seem to run really smooth to me!
To conclude:
I suspect it does not work using retropie image from the website. If you manually install, it works! Please, correct me if I'm wrong.
And, many thanks to you guys for the amazing information you share!
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.