Ubuntu 通过RTMP从无头服务器进行广播

Ubuntu 通过RTMP从无头服务器进行广播,ubuntu,rtmp,broadcasting,twitch,Ubuntu,Rtmp,Broadcasting,Twitch,我的问题如下,我有一个运行webbrowser的无头服务器ubuntu桌面,我希望能够通过RTMP向twitch广播我的屏幕 我目前正在使用以下脚本: #! /bin/bash INRES="640x480" # input resolution OUTRES="640x480" # Output resolution FPS="25" # target FPS QUAL="fast" # FFMPEG pre

我的问题如下,我有一个运行webbrowser的无头服务器ubuntu桌面,我希望能够通过RTMP向twitch广播我的屏幕

我目前正在使用以下脚本:

#! /bin/bash

INRES="640x480"         # input resolution
OUTRES="640x480"        # Output resolution
FPS="25"                # target FPS
QUAL="fast"             # FFMPEG preset

STREAM_KEY=$(cat ~/.twitch_key)

avconv \
    -f x11grab -s $INRES  -r "$FPS" -i :0.0 \
    -vcodec libx264 -s $OUTRES -preset $QUAL -b 768k -r "$FPS" \
    -f flv "rtmp://live.twitch.tv/app/$STREAM_KEY"

到目前为止,使用这个脚本,我能够广播我的登录屏幕,但我似乎不能得到任何进一步的。我做错什么了吗?有更好的方法吗?

您需要在选项中添加-pix_fmt yuv420p。如果没有它,x264将使用High 444对x11grabs输出进行编码。很少有解码器支持高444。

我不明白。如果你能广播,那还有什么呢?接下来会发生什么?你断开了吗?