0

我有一个关于 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

任何帮助任何帮助都非常感谢!

4

1 回答 1

0

我可以如下解码管道以查看它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

在写入文件之前,我对其进行解码并使用视频速率对其进行编码。可能有一种更优化的方法来执行相同的操作,但这只是一种解决方法。

于 2013-03-09T22:03:54.417 回答