Live streaming RetroArch

I’ve been working on adding lossy encoding possibilities for RetroArch. To do this, I had to make the encoder more flexible, which means a config file specifically for the recorder.

Now, FFmpeg supports outputting to RTMP, which means, we can now record directly and have it streamed to live services like Twitch. Example config:


# twitch.cfg
vcodec = libx264
pix_fmt = yuv420p # twitch only supports yuv420p
scale_factor = 2 # Upscales with 2x to preserve chroma
acodec = libmp3lame
audio_global_quality = 75
sample_rate = 44100
format = flv # Flash muxer

video_crf = 25 # -crf
video_tune = animation # -tune
video_preset = superfast # -preset
threads = 3 # x264 threads

Example RetroArch invocation:


retroarch --record rtmp://live.twitch.tv/app/live_37868136_jKiYTKHcOEJTBSCO4nabcdefgdrwqi --recordconfig twitch.cfg # Use your twitch streaming address, this one is obviously fake ;)

You’ll need a fairly recent FFmpeg build. I’ve updated redist for Windows users. For now, you’ll have to build yourself to get this functionality.

This is wonderful :smiley: I built the code from your FFmpeg repository.


# test.cfg
video_preset = ultrafast
acodec = libmp3lame
scale_factor = 2

Take a look at the video below.

define HAVE_SINC = 1 https://dl.dropbox.com/u/102023246/record_sinc.mkv

not defined HAVE_SINC https://dl.dropbox.com/u/102023246/record_hermite.mkv

Why sinc resampler quality is bad? It’s good quality of hermite.

OS : Win7 32bit RetroArch : v0.9.8-beta3-225-g78d0edc

Thanks.

Are you busy?

Sorry, please ignore my previous quesion. I don’t mind it :slight_smile:

Try a rebuild, there was a bug in Sinc that lasted for a couple of hours. Shouldn’t have impacted audio quality, though, but anyways. Sinc works fine here.

Thanks for your reply.

If not recorded or recorded in flac codec, no problem. I think so bad quality is recorded in libmp3lame. (but not so bad)

http://forum.themaister.net/viewtopic.php?pid=961#p961 Fixed link. Please take a look at the linked video.

Can you reproduce the problem?

Actually, I’m stupid. There was a serious regression. Hopefully fixed now.

Oh, thank you for making the revisions :smiley:

Added an article to the Wiki: https://github.com/Themaister/RetroArch/wiki/FFmpeg-recording-and-live-streaming

Anybody have a Win32 build of a version that includes this?

NB, this is also useful with v4l2loopback under linux.

Kernel module? Bah, sounds like something that could have been implemented easily with CUSE.

True. But I am yet to see a useful CUSE implementation.

A FUSE version of retroarch would be good for use with portable Wi-Fi Linux machines, e.g. Seagate Satellite and PQI Air Wi-Fi.

tried to put in my key (nightmare), saved current config in retroarch, relaunched retroarch, key forgotten :<

honestly, you’re better off using something like OBS for Twitch streaming these days.