Livestreaming to twitch on retropie 4.4?
-
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
-
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.
-
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?
-
@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.
-
@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. -
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:
- 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.
- Most guides suggest
acodec = libfdk_aac
for audio, but this codec doesn't appear to be available to RetroPie on a Raspberry Pi. Fortunatelyacodec = 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%" -
@foolsrun how do i go about disabling overlays and custom scailing? are they in the retroarch menus?
-
@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.cfgvcodec = libx264
acodec = aac
pix_fmt = yuv420p
threads = 2
scale_factor = 1
format = flvvideo_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 = 60sample_rate = 44100
audio_preset = aac_he_v2
audio_global_quality = 1nano /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$$>> -
@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.
-
-
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.