2011-10-27 97 views
0

我有一個關於gstreamer的問題。 我使用gst-rtsp-server製作了流媒體服務器。我試圖將相機捕獲發送到另一臺機器(在本地網絡上)並將其解析爲.ogv文件。用gst-rtsp-server接收流

流傳輸工作正常,我能夠解析信息到文件;但是我無法讀取它,或者在解析之後將它用於任何應用程序。它似乎有一些信息缺失(可能與編碼技術的關係,我真的不知道很多關於它)

服務器端的命令(內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 

任何幫助任何形式的幫助,非常感謝!

+0

有沒有人有想法? – Athanase

+0

如果這仍然是最新的,您可能想要添加有關RTSP客戶端應用程序顯示的錯誤的信息。 – che

回答

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

我對其進行解碼並寫入之前編碼它帶回了videorate文件。可能有更好的方法來執行相同的操作,但這只是一種解決方法。