1

我正在尝试使用 GStreamer 制作 UDP 多播屏幕流。我的屏幕投射服务器应该在 Windows 上运行,而我的客户端应该在 Linux 上运行

如果我在服务器之前启动客户端,一切都很好。

问题是当我启动客户端并且服务器已经启动时。视频收到了,但是严重失真。

这就是结果。

服务器:

gst-launch-1.0 -e gdiscreencapsrc ! queue ! video/x-raw, framerate=25/1 ! videoconvert ! \
       x264enc noise-reduction=10000 tune=zerolatency bitrate=2500  speed-preset="fast" byte-stream=true threads=4 key-int-max=15 intra-refresh=true ! \
             h264parse ! rtph264pay config-interval=1 \
       ! udpsink host=224.1.1.1 port=5000 auto-multicast=true

客户:

gst-launch-1.0 -v udpsrc multicast-group=224.1.1.1 auto-multicast=true port=5000 ! application/x-rtp  ! rtph264depay ! h264parse ! queue ! decodebin ! videoconvert ! autovideosink caps='video/x-raw, format=RGB'

我已经尝试过使用dx9screencapsrc,但行为是一样的。仅当我替换gdiscreencapsrcvideotestsrc.

如果我在 Linux 上使用 启动服务器ximagesrc,我仍然会遇到一些问题,但视频会随着时间的推移而改进。

任何帮助,将不胜感激!

4

1 回答 1

1

添加cabac=false到我的 x264enc 元素中修复了问题。

gst-launch-1.0 -v gdiscreencapsrc ! queue ! video/x-raw,framerate=60/1 ! decodebin ! videoscale ! videoconvert ! \
       x264enc cabac=false tune=zerolatency bitrate=4000  speed-preset="fast" ! \
             h264parse ! rtph264pay config-interval=-1 \
       ! udpsink host=224.1.1.1 port=5000 auto-multicast=true sync=false
于 2018-07-16T11:50:11.223 回答