【问题标题】:VNC screen live streaming with GStreamer使用 GStreamer 进行 VNC 屏幕直播
【发布时间】:2020-09-05 09:14:17
【问题描述】:

简介

我一直在尝试使用 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',

我正在尝试使用另一种捕获方式 - 对来自标准输入的帧进行编码,但实际上我使用以下管道没有成功:

'--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】:

    最后,我通过以下管道解决了这个问题:

    '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) 获得的原始图像。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-21
      • 2019-03-17
      • 2012-03-16
      • 2023-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多