Teléfono y Whatsapp: 675 18 68 80

Emitir desde ffmpeg a LiveStream

Con este simple script y configurando los cinco primeros parámetros, es posible transmitir la captura de tu pantalla en GNU/Linux al popular servicio online LiveStream. Para ello hace falta tener instalado x11grab.

CHANNEL="YOURCHANNEL"
USER="YOURUSERNAME"
PASSWD="YOURPASSWORD"
W_RATIO=16
H_RATIO=9
 
AUDIO="-f mp3 -i http://localhost:8000"
 
ffmpeg \
$AUDIO \
-f x11grab -r 24 -s 1920x1080 -i :0.0 \
-c:v libx264 -s 768x432 -b:v $1k -bufsize 128k\
-f flv "rtmp://publish.livestream.com/mogulus/$CHANNEL/username=$USER/password=$PASSWD/isAutoLive=true/autoVOD=true/autoRecord=true/autoPilot=true/aspectWidth=$W_RATIO/aspectHeight=$H_RATIO app=mogulus/$CHANNEL/username=$USER/password=$PASSWD/isAutoLive=true/autoVOD=true/autoRecord=true/autoPilot=true/aspectWidth=$W_RATIO/aspectHeight=$H_RATIO tcurl=rtmp://publish.livestream.com/mogulus/$CHANNEL/username=$USER/password=$PASSWD/isAutoLive=true/autoVOD=true/autoRecord=true/autoPilot=true/aspectWidth=$W_RATIO/aspectHeight=$H_RATIO swfUrl=rtmp://publish.livestream.com/mogulus/$CHANNEL/username=$USER/password=$PASSWD/isAutoLive=true/autoVOD=true/autoRecord=true/autoPilot=true/aspectWidth=$W_RATIO/aspectHeight=$H_RATIO flashver=FFMPEG live=true"
 
# -f alsa -ac 2 -ar 44100 -i hw:0,0\