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

    Livestreaming to twitch on retropie 4.4?

    Scheduled Pinned Locked Moved Help and Support
    retropie help
    9 Posts 6 Posters 4.9k 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.
    • O
      Oakmana
      last edited by

      Hello, I had a question now that 4.4 has come out. In the changelogs, it said that ffmpeg now comes with stretch. Before hand, I would manually install ffmpeg and create new config options to record to twitch's server to livestream. If anyone wants specifics, I used these two guides:
      http://selsine.com/2016/10/15/how-to-record-a-game-play-video-from-a-retropie/
      http://selsine.com/2016/10/17/how-to-live-stream-to-youtube-from-a-retropie/

      In that order. Since 4.4 has ffmpeg already, how do I setup recording to twitch now?

      Pi Model or other hardware: 3
      Power Supply used: 5V 2.4 Amp
      RetroPie Version Used: 4.4
      Built From: Pre made SD Image on RetroPie website

      #Retropie #Help

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by mitu

        You can use the same setup, but on the new 4.4 version you can skip installing ffmpeg and re-compiling RetroArch, it's already included. For streaming to Twitch, you can try the settings at http://www.retroarch.com/index.php?page=recording - instead of writing the video to a file, send it to a stream.

        1 Reply Last reply Reply Quote 1
        • F
          foolsrun
          last edited by

          I've tried just about every way I can to stream to Twitch using RetroPie 4.4 and @selsine 's configuration with no luck.

          The best I can seem to accomplish is Twitch Inspector showing that I'm "live", but with no audio or video.

          I've tried both Retroarch's configuration file and Selsine's.

          Has anyone pulled this off? Is there a working config out there somewhere?

          1 Reply Last reply Reply Quote 0
          • ClydeC
            Clyde
            last edited by

            @foolsrun Do you know the thread RetroPie Screen Mirroring / Streaming / Casting from @herb_fargus? It lists some ways to stream from Retropie, but I don't know if any of them work with Twitch.

            F 1 Reply Last reply Reply Quote 0
            • F
              foolsrun @Clyde
              last edited by

              @clyde I’ll definitely look into those. It just seems like the —record option should be workable since it’s worked in the past and is built into retroarch.

              1 Reply Last reply Reply Quote 0
              • F
                foolsrun
                last edited by

                I got this working!

                My problem was due to a few configuration things, both in my setup, and in the configuration files others have shared. Here's what worked:

                1. Remove overlays and custom scaling from your emulator. libx264 requires that your viewport's height be divisible by 2, so custom viewport sizes will prevent recording from working.
                2. Most guides suggest acodec = libfdk_aac for audio, but this codec doesn't appear to be available to RetroPie on a Raspberry Pi. Fortunately acodec = aac is and it works!

                Here's my complete twitch.cfg file:

                vcodec = libx264
                acodec = 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
                

                And here's an example of from one of my emulators.cfg files:

                lr-mgba-record-twitch = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mgba/mgba_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg --recordconfig /home/pi/RetroPie/recording/twitch.cfg --record rtmp://live.
                /fake-streaming-key-here %ROM%"
                O 1 Reply Last reply Reply Quote 1
                • O
                  Oakmana @foolsrun
                  last edited by

                  @foolsrun how do i go about disabling overlays and custom scailing? are they in the retroarch menus?

                  1 Reply Last reply Reply Quote 0
                  • H
                    HairyAdmin
                    last edited by HairyAdmin

                    @foolsrun Fantastic! That indeed worked. I basically modified the blog post with your settings:
                    http://selsine.com/2016/10/17/how-to-live-stream-to-youtube-from-a-retropie/

                    That being said, and maybe I'm pushing it here... I wonder if there is a way to capture microphone audio of some kind. For Ha-has, I plugged in my PS4 mono headset during the stream, but the audio did not broadcast. I wonder what needs to be done in order to get that working, too.

                    For anyone needing step-by-step instructions, here is what I did for streaming to Twitch from my Pi 3 B+ to work:

                    mkdir /home/pi/RetroPie/recording
                    nano /home/pi/RetroPie/recording/twitch.cfg

                    vcodec = libx264
                    acodec = 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

                    nano /opt/retropie/configs/nes/emulators.cfg

                    lr-fceumm-record-twitch = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-fceumm/fceumm_libretro.so --config /opt/retropie/configs/nes/retroarch.cfg --recordconfig /home/pi/RetroPie/recording/twitch.cfg --record <<rtmp://live.

                    /$$STREAM KEY$$>>

                    1 Reply Last reply Reply Quote 0
                    • Dreebus ColeD
                      Dreebus Cole
                      last edited by Dreebus Cole

                      @HairyAdmin I followed your instructions, but with your emulator string my roms will not even play. Using the emulator string from the article [link text]http://selsine.com/2016/10/16/how-to-live-stream-to-twitch-from-a-retropie/(link url), I can get the game to play, but it will not stream to twitch, or even register anything on twitch.

                      Here is what I have so far.

                      I am running 4.4 on a raspberry 3 b+.

                      /home/pi/RetroPie/Recording/Twitch.cfg

                      vcodec = libx264
                      acodec = 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
                      

                      /opt/retropie/configs/nes/emulators.cfg

                      lr-fceumm = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-fceumm/fceumm_libretro.so --config /opt/retropie/configs/nes/retroarch.cfg %ROM%"
                      default = "lr-fceumm-record-twitch"
                      lr-nestopia = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-nestopia/nestopia_libretro.so --config /opt/retropie/configs/nes/retroarch.cfg %ROM%"
                      lr-quicknes = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-quicknes/quicknes_libretro.so --config /opt/retropie/configs/nes/retroarch.cfg %ROM%"
                      lr-fceumm-record-twitch = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-fceumm/fceumm_libretro.so --config /opt/retropie/configs/nes/retroarch.cfg --record rtmp://live . 
                      / $$STREAMKEY$$ --recordconfig /home/pi/RetroPie/recording/twitch.cfg %ROM%"

                      Any assistance would be swell, and please type slow, because I can't read fast.

                      1 Reply Last reply Reply Quote 0
                      • A about-bl4nk referenced this topic on
                      • Y yooodt referenced this topic on
                      • 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.