我正在寻找一种连接到VNC并使用GStreamer录制视频的方法。到目前为止,我可以连接到VNC服务器,但只能使用 autovideosink 观看视频。我想将视频保存到文件中。
这是我尝试并正在工作的:
gst-launch-1.0 -e -vvv rfbsrc host=127.0.0.1 width=1024 height=768 shared=true view-only=true ! videoscale ! video/x-raw,width=1024,height=576 ! videorate ! videoconvert ! autovideosink
这用于使用文件接收器保存视频文件:
gst-launch-1.0 -e -vvv rfbsrc host=127.0.0.1 width=1024 height=768 shared=true view-only=true ! videoscale ! video/x-raw,width=1024,height=576 ! videorate ! videoconvert ! filesink location=video.flv
结果: 保存的文件很大,无法播放。
任何输入都会有很大帮助。预先谢谢你。
答案 0 :(得分:0)
最后成功了。对mov输出文件进行了一些更改:
gst-launch-1.0 -e -vvvv rfbsrc host=127.0.0.1 port=5900 ! videoconvert ! x264enc ! video/x-h264, profile=baseline ! qtmux ! filesink location=output.mov
发布答案以供将来参考。谢谢。