VNC屏幕直播与GStreamer

问题描述 投票:1回答:1

介紹

我一直想用GStreamer捕捉vnc画面,然后发送到rtp端点。我已经用了一个 rfbsrc 插件,但它的工作不稳定,有第一帧的损失和冻结.也许有一个问题在我的GStreamer管道:

'--gst-debug=2',
'-vvv',
'rtpbin', 'name=rtpbin', 'rtp-profile=avpf', 'latency=100',
'rfbsrc', `host=${rfbConfig.host}`, `port=${rfbConfig.port}`,
'!', 'videoconvert',
'!', 'x264enc', 'tune=zerolatency', 'speed-preset=1', 'dct8x8=true', 'quantizer=23', 'pass=qual',
'!', 'video/x-h264, profile=baseline',
'!', 'rtph264pay', 'ssrc=111110', 'pt=96',
'!', 'queue2',
'!', 'rtprtxqueue', 'max-size-time=2000', 'max-size-packets=0',
'!', 'rtpbin.send_rtp_sink_0',
'rtpbin.send_rtp_src_0',
'!', 'udpsink', 'bind-address=127.0.0.1', 'host=127.0.0.1', 'bind-port=5004', `port=${videoRtpPort}`,
'rtpbin.send_rtcp_src_0',
'!', 'udpsink', 'bind-address=127.0.0.1', 'host=127.0.0.1', `port=${videoRtcpPort}`, 'sync=false', 'async=false', 'udpsrc', 'port=5005',
'!', 'rtpbin.recv_rtcp_sink_0',

我试图使用另一种捕捉方式--从stdin编码帧,但实际上我用下面的管道没有成功。

'--gst-debug=2',
'-vvv',
'rtpbin', 'name=rtpbin', 'rtp-profile=avpf', 'latency=100',
'fdsrc',
'!', 'videoparse', 'width=1280', 'height=720', 'framerate=15/1',
'!', 'queue',
'!', 'x264enc', 'tune=zerolatency', 'speed-preset=1', 'dct8x8=true', 'quantizer=23', 
'pass=qual',
'!', 'video/x-h264, profile=baseline',
'!', 'rtph264pay', 'ssrc=111110', 'pt=96',
'!', 'queue2',
'!', 'rtprtxqueue', 'max-size-time=2000', 'max-size-packets=0',
'!', 'rtpbin.send_rtp_sink_0',
'rtpbin.send_rtp_src_0',
'!', 'udpsink', 'bind-address=127.0.0.1', 'host=127.0.0.1', 'bind-port=5004', 
`port=${videoRtpPort}`,
'rtpbin.send_rtcp_src_0',
'!', 'udpsink', 'bind-address=127.0.0.1', 'host=127.0.0.1', `port=${videoRtcpPort}`, 
'sync=false', 'async=false', 'udpsrc', 'port=5005',
'!', 'rtpbin.recv_rtcp_sink_0',

问题是

用 GStreamer 捕捉 vnc 屏幕并发送至 RTP 端点的正确方法是什么?我的GStreamer管道有什么明确的错误吗?

encoding gstreamer rtp vnc rfb-protocol
1个回答
0
投票

最后,我用下面的流水线解决了这个问题。

'gst-launch-1.0',
'-vvv',
'rtpbin', 'name=rtpbin', 'rtp-profile=avpf',
'fdsrc', 'timeout=1000000',
'!', 'queue', 'max-size-bytes=0', 'max-size-buffers=0', 'max-size-time=0', 'min-threshold-buffers=1',
'!', 'image/x-portable-pixmap,width=1280,height=720,framerate=30/1',
'!', 'pnmdec',
'!', 'videoconvert',
'!', 'x264enc', 'tune=zerolatency', 'speed-preset=1', 'dct8x8=true', 'quantizer=23', 'pass=qual',
'!', 'video/x-h264, profile=baseline',
'!', 'rtph264pay', 'ssrc=111110', 'pt=96',
'!', 'rtprtxqueue', 'max-size-time=2000', 'max-size-packets=0',
'!', 'rtpbin.send_rtp_sink_0',
'rtpbin.send_rtp_src_0',
'!', 'udpsink', 'bind-address=127.0.0.1', 'host=127.0.0.1', 'bind-port=5004', `port=${videoRtpPort}`,
'rtpbin.send_rtcp_src_0',
'!', 'udpsink', 'bind-address=127.0.0.1', 'host=127.0.0.1', `port=${videoRtcpPort}`, 'sync=false', 'async=false', 'udpsrc', 'port=5005',
'!', 'rtpbin.recv_rtcp_sink_0',

我用了... pnmdec 解码从rfb(vnc)得到的原始图像。

© www.soinside.com 2019 - 2024. All rights reserved.