RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    How-to guide: Recording Live Gameplay in RetroPie’s RetroArch Emulators Natively on the Raspberry Pi (and Twitch streaming)

    Scheduled Pinned Locked Moved Help and Support
    recordingvideo captureffmpeglibretroretroarch
    80 Posts 20 Posters 47.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      shaun040 @RetroResolution
      last edited by

      @RetroResolution Thanks for replying!

      RetroPie - 4.0.3

      RGUI - 1.3.6

      I've tried both accessing the RGUI menu via an emulator and the sub menu in emulation station. Once in the RGUI menu, I can use the arrow keys to select various menu items then pressing right shift is when I get the error.

      In regards to setup, I tried both the default which pulls the latest then also tried the code to pull an exact version with the same results.

      The very peculiar thing is I have a old SD card with RP 1.2.2 from a pre-built image and get the same error trying to get deeper into settings. Am I missing something simple? Is there a special key to get into sub menus? Enter doesn't work and it seems right shift and arrow keys are the only keys that do anything.

      Cheers,
      Shaun

      R 1 Reply Last reply Reply Quote 0
      • R
        RetroResolution @shaun040
        last edited by

        @shaun040 Hi,

        Technically nothing actually needs to be done from within the RetroArch RGUI menu to configure the recording feature once it's been enabled during the build phase, but as you noted the feature isn't working for you via the runcommand menu configuration.

        I'm unsure why you're not able to navigate RGUI which makes me wonder if something isn't working in the rebuilding RetroArch step (although given that you've used both approaches it's unlikely that this is the problem).

        As a test, can you revert the RetroArch installation by installing the latest binary using the RetroPie-Setup menu, then test if you can navigate RGUI? You should be able to use whichever controller you have configured - if it works within the emulator, it should work within RGUI.

        Have you checked the runcommand log ouput to see if it's revealing any information regarding the failure of the recording? On pre v4 RetroPie this was in \tmp\runcommand.log, but on the latest version I tested on I noticed this log file has been moved (unfortunately I can't recall where the new location is - my working system is still running RetropIe 3.8; my test system has just been re-purposed as a media center, and my new Raspberry Pi 3 test machine hasn't yet had RetroPie installed)

        If a post has helped you, please encourage the author by up-voting via the ^ icon located in the bottom-right corner.

        RetroResolution.com - Adventures in retro gaming on original hardware and via emulation with RetroPie on the Raspberry Pi.

        S 1 Reply Last reply Reply Quote 0
        • S
          shaun040 @RetroResolution
          last edited by

          @RetroResolution Ok, so I managed to get settings to work.

          Before I was logging into the machine via console then launching emulationstation by just running that command from the shell.

          From there...rgui would only work with a keyboard since that was always plugged in on boot. Controller wouldn't work even if I unplugged the keyboard.

          I then set emulationstation to start on boot and unplugged the keyboard so only the controller is there at the start. I can now get to the sub-menus in Settings! Success!

          So as you mentioned in your article, the Recording menu is not there. However, I do see the Record function in the Driver menu but it is set to "null". I did check I ran the script without the --disable-ffmpeg. I'm now in the process of recompiling ffmpeg then going to re-run retroarch_packages.sh and check again.

          I'll let you know how that goes!

          Cheers,
          Shaun

          R 1 Reply Last reply Reply Quote 0
          • R
            RetroResolution @shaun040
            last edited by RetroResolution

            @shaun040 Hi,

            I've just noticed that the Raspbian image has been updated with a new 'Pixel' X-Windows desktop. I don't know if this has any impact - it shouldn't as far as I know, but you can never tell.

            I'll start putting together an installation with the latest Raspbian Jessie / Pixel as the base, then I'll run through building ffmpeg, and finally install RetroPie and see if it works.

            Is your RetroPie installation built on top of a Raspbian Jessie image, or did you use a RetroPie image as the base? (In all my tests I've always started with Raspian as the base, as per my guide https://retroresolution.com/2016/03/31/multipurpose-raspberry-pi-installing-a-media-gaming-pc-replacement/)

            If a post has helped you, please encourage the author by up-voting via the ^ icon located in the bottom-right corner.

            RetroResolution.com - Adventures in retro gaming on original hardware and via emulation with RetroPie on the Raspberry Pi.

            1 Reply Last reply Reply Quote 0
            • R
              RetroResolution
              last edited by

              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.

              If a post has helped you, please encourage the author by up-voting via the ^ icon located in the bottom-right corner.

              RetroResolution.com - Adventures in retro gaming on original hardware and via emulation with RetroPie on the Raspberry Pi.

              1 Reply Last reply Reply Quote 0
              • R
                RetroResolution
                last edited by RetroResolution

                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!

                If a post has helped you, please encourage the author by up-voting via the ^ icon located in the bottom-right corner.

                RetroResolution.com - Adventures in retro gaming on original hardware and via emulation with RetroPie on the Raspberry Pi.

                S 1 Reply Last reply Reply Quote 0
                • S
                  shaun040 @RetroResolution
                  last edited by

                  @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!

                  R 1 Reply Last reply Reply Quote 0
                  • R
                    RetroResolution @shaun040
                    last edited by

                    @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)?

                    If a post has helped you, please encourage the author by up-voting via the ^ icon located in the bottom-right corner.

                    RetroResolution.com - Adventures in retro gaming on original hardware and via emulation with RetroPie on the Raspberry Pi.

                    1 Reply Last reply Reply Quote 0
                    • S
                      shaun040
                      last edited by

                      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.

                      R 1 Reply Last reply Reply Quote 0
                      • R
                        RetroResolution @shaun040
                        last edited by

                        @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!)

                        If a post has helped you, please encourage the author by up-voting via the ^ icon located in the bottom-right corner.

                        RetroResolution.com - Adventures in retro gaming on original hardware and via emulation with RetroPie on the Raspberry Pi.

                        R 1 Reply Last reply Reply Quote 0
                        • R
                          RetroResolution @RetroResolution
                          last edited by

                          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.

                          If a post has helped you, please encourage the author by up-voting via the ^ icon located in the bottom-right corner.

                          RetroResolution.com - Adventures in retro gaming on original hardware and via emulation with RetroPie on the Raspberry Pi.

                          R 1 Reply Last reply Reply Quote 0
                          • R
                            RetroResolution @RetroResolution
                            last edited by

                            @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:

                            https://retroresolution.com/2016/03/31/multipurpose-raspberry-pi-installing-a-media-gaming-pc-replacement/

                            If a post has helped you, please encourage the author by up-voting via the ^ icon located in the bottom-right corner.

                            RetroResolution.com - Adventures in retro gaming on original hardware and via emulation with RetroPie on the Raspberry Pi.

                            1 Reply Last reply Reply Quote 0
                            • S
                              selsine
                              last edited by

                              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.

                              R 1 Reply Last reply Reply Quote 2
                              • R
                                RetroResolution @selsine
                                last edited by

                                @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

                                If a post has helped you, please encourage the author by up-voting via the ^ icon located in the bottom-right corner.

                                RetroResolution.com - Adventures in retro gaming on original hardware and via emulation with RetroPie on the Raspberry Pi.

                                1 Reply Last reply Reply Quote 0
                                • R
                                  RetroResolution
                                  last edited by

                                  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!

                                  If a post has helped you, please encourage the author by up-voting via the ^ icon located in the bottom-right corner.

                                  RetroResolution.com - Adventures in retro gaming on original hardware and via emulation with RetroPie on the Raspberry Pi.

                                  S 1 Reply Last reply Reply Quote 1
                                  • S
                                    selsine @RetroResolution
                                    last edited by selsine

                                    @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:

                                    S 1 Reply Last reply Reply Quote 0
                                    • S
                                      selsine @selsine
                                      last edited by

                                      @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
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • RionR
                                        Rion
                                        last edited by

                                        How about Youtube streaming? Is it possible?

                                        FBNeo rom filtering
                                        Mame2003 Arcade Bezels
                                        Fba Arcade Bezels
                                        Fba NeoGeo Bezels

                                        S 1 Reply Last reply Reply Quote 0
                                        • S
                                          selsine @Rion
                                          last edited by

                                          @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.

                                          1 Reply Last reply Reply Quote 2
                                          • R
                                            retroday
                                            last edited by

                                            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-mmal

                                            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?

                                            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.

                                            S 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.