0

My friend has just began streaming, but on his Xbox One. I use PC to stream my games and have never done it through Xbox One. Now he streams using the Twitch app. But i have this RTMP Server which i can use to stream his stream to Twitch with having some extra enhancements! How do i do this?

Collin
  • 1
  • 3

1 Answers1

0

Setup transparent proxy for RTMP. kinda like this. A ddwrt router is probablly best, but any linux box should work.

#!/bin/sh
XBO=192.168.1.20
PROXY_IP=192.168.1.2    
RTMP_PORT=1935
LAN_IP=`nvram get lan_ipaddr`
LAN_NET=$LAN_IP/`nvram get lan_netmask`

iptables -t nat -A PREROUTING -i br0 -s $XBO -d $LAN_NET -p tcp --dport $RTMP_PORT -j ACCEPT
iptables -t nat -A PREROUTING -i br0 -s ! $PROXY_IP -p tcp --dport $RTMP_PORT -j DNAT --to $PROXY_IP:$RTMP_PORT
iptables -t nat -I POSTROUTING -o br0 -s $LAN_NET -d $PROXY_IP -p tcp -j SNAT --to $LAN_IP
iptables -I FORWARD -i br0 -o br0 -s $LAN_NET -d $PROXY_IP -p tcp --dport $RTMP_PORT -j ACCEPT

Then configure nginx almost exactly like this. Modify the nginx config slightly (below) and started the broadcast on the ps4 this is the result

Just change the exec command to do whatever you want

rtmp {
server {
        listen 1935;
        chunk_size 4096;

        application app {
                live on;  
                record off;
                exec ffmpeg -i rtmp://localhost/app/$name -filter_complex "drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:text='m3u8':fontsize=50:fontcolor=white@0.8:x=100:y=100" -c:v libx264 -g 2 -profile:v main -b:v 800K -s 640x480 -f flv -c:a aac -ac 1 -strict -2 -b:a 56k rtmp://live.twitch.tv/app/$name;
        }
    }
}
szatmary
  • 29,969
  • 8
  • 44
  • 57