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?
Asked
Active
Viewed 1,861 times
1 Answers
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
-
His Xbox One is at his house and the server is at mine? So how will this work? Which place do i set up the linux box/transparent proxy for RTMP? – Collin Dec 09 '15 at 13:26
-
It may work to put the the ip at his location. Or you can run an ssh tunnel. – szatmary Dec 09 '15 at 15:53
-
-
Please move this topic to super user. Stack overflow is for programming. – szatmary Dec 09 '15 at 22:35
-
Moved @szatmary https://superuser.com/questions/1011402/how-can-my-friend-stream-a-game-from-his-xbox-one-to-my-rtmp-server – Collin Dec 10 '15 at 02:34