使用gst-rtsp-server接收流

receive Stream with gst-rtsp-server

本文关键字:gst-rtsp-server 使用      更新时间:2023-10-16

我有一个关于gstreamer的问题。我用gst-rtsp-server做了一个流媒体服务器。我正在尝试将相机捕获发送到另一台机器(在本地网络上)并将其解析为。ogv文件。

流的传输工作正常,我能够将信息解析到文件中;但是,我无法读取它,也无法在任何应用程序中使用它。似乎有一些信息缺失(可能与编码技术有关,我真的不太了解它)

服务器端命令(c++代码内部):

....
gst_rtsp_media_factory_set_launch (factory, "( v4l2src device=/dev/video0 ! videorate !         
video/x-raw-yuv,width=320,height=240,framerate=30/1 ! videoscale ! ffmpegcolorspace !
theoraenc ! rtptheorapay name=pay0 pt=96 )");
gst_rtsp_media_factory_set_shared (factory, TRUE);
/* attach the test factory to the /test url */
gst_rtsp_media_mapping_add_factory (mapping, "/stream", factory);
....

客户端命令(终端命令):

gst-launch -v rtspsrc location=rtsp://192.168.0.115:8554/stream ! 
rtptheoradepay name=pay0 ! oggmux ! filesink location=/home/jean/Desktop/stream.ogv

任何帮助任何形式的帮助都是非常感激的!

我可以对管道进行如下解码以查看它gst-launch -v rtspsrc location="rtsp://localhost:8554/test" name=demux demux. ! queue ! rtptheoradepay ! theoradec ! ffmpegcolorspace ! autovideosink

解码

gst-launch -v rtspsrc location="rtsp://localhost:8554/test" ! application/x-rtp, payload=96 ! rtptheoradepay ! theoradec ! videorate ! ffmpegcolorspace ! theoraenc ! oggmux ! filesink location=GIBBERISH.ogg

在写入文件之前,我对其进行解码并使用div将其编码回来。可能有一种更优的方法来执行相同的操作,但它只是一个工作。