Restreaming video from XSplit to multiple JustinTV/TwitchTV channels in different resolutions and bitrates

StackOverflow https://stackoverflow.com/questions/12181626

Question

I have a really simple question but the answer may be a little more complex I guess.

Okay. Let's go. I have an Application called Xsplit Broadcaster (http://www.xsplit.com/). It supports streaming video through RTMP. Now what I want to do is this:

                                              +--(720p)--> TwitchTV FirstChannel
XSplit --(720p RTMP)-->[MyTranscodingServer]--+
                                              +--(360p)--> TwitchTV SecondChannel

Is there a simple way to do this?

Additional info: Both channels accept standard RTMP stream on their RTMP endpoint using either username/password or streamkey. The server operating system is GNU/Linux

Was it helpful?

Solution

Yes answer is a bit more complex. The simplest way to do this is to use Gstreamer www.gstreamer.net to do the above. It will recieve rtmp and then you can transcode it off to two other formats. However you do have to learn gstreamer a bit if you don't know it.

Another option would be ffmpeg where you read the source duplicate it (say into named pipes) and run two ffmpeg for two outputs.

Both methods will work. gstreamer will allow you to write your own application which can give you more control in the future. ffmpeg is equally powerful (gstreamer uses ffmpeg for a lot of operation) but as I said before gst applications will give more flexibility (if you need it) in the future. However you can get the first version running off the command line.

Something like this should work for gstreamer: [you have to find the exact pipeline you need. This is just a guideline]

 gst-launch rtmpsrc <options> ! decodebin2 name=d ! tee name=vt ! queue ! x264enc <options> ! flvmux name=m1 ! rtmpsink d. ! tee name=at ! faac <options> ! m1. vt. ! queue ! x264enc <otheroptions> ! flvmux name=m2 ! rtmpsink at. ! queue ! faac <otheroptions> m2. 

FFmpeg cmd line should be something like:

 ffmpeg -i rtmp://src -acodec aac <audio options> -vcodec libx264 <video options> -f flv rtmp://output  

But I am not 100% sure whether it will give rtmp output directly like that.Perhaps you may have to use ffserver if it doesn't.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top