使用 gst-rtsp-server 接收流
我有一个关于 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
任何帮助任何类型的帮助非常感谢!
让
I have a question about gstreamer.
i made a streaming server using gst-rtsp-server. I'm trying to send camera capture to another machine (on the local network) and to parse it into an .ogv file.
The transmission of the streaming works fine, and i'm able to parse the informations into the file; but i can't read it or use it with any application after this parsing. It seems that there are some information missing (probably in relation with the encoding technique, i don't really know much about it)
Server side command (inside c++ code):
....
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);
....
Client side command (terminal command) :
gst-launch -v rtspsrc location=rtsp://192.168.0.115:8554/stream !
rtptheoradepay name=pay0 ! oggmux ! filesink location=/home/jean/Desktop/stream.ogv
Any help any kind of help is well appreciated !
Jean
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可以按如下方式解码管道以查看它
gst-launch -v rtspsrc location="rtsp://localhost:8554/test" name=demux demux。 !队列 ! rtp理论付款!理论! ffmpeg颜色空间! autovideosink
解码它
gst-launch -v rtspsrc location="rtsp://localhost:8554/test" !应用程序/x-rtp,有效负载=96! rtp理论付款!理论!视频率! ffmpeg颜色空间!理论!奥格多路复用器! filesink location=GIBBERISH.ogg
在写入文件之前,我对其进行解码并用视频速率对其进行编码。可能有一种更优化的方法来执行相同的操作,但这只是一种解决方法。
I could decode the pipeline as follows to view it
gst-launch -v rtspsrc location="rtsp://localhost:8554/test" name=demux demux. ! queue ! rtptheoradepay ! theoradec ! ffmpegcolorspace ! autovideosink
To decode it
gst-launch -v rtspsrc location="rtsp://localhost:8554/test" ! application/x-rtp, payload=96 ! rtptheoradepay ! theoradec ! videorate ! ffmpegcolorspace ! theoraenc ! oggmux ! filesink location=GIBBERISH.ogg
I decode it and encode it back with the videorate before writing to the file. There may be a more optimal way to perform the same but it is just a work around.