首页 > 解决方案 > 有没有办法将 RFB (vnc) 流保存到文件中?[GStreamer]

问题描述

我正在寻找一种连接到 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

这是为了使用filesink保存视频文件:

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

结果:保存的文件很大,无法播放。

任何输入都会有很大帮助。先感谢您。

标签: gstreamer

解决方案


终于成功了。对 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

发布答案以供将来参考。谢谢。


推荐阅读