2016-05-13 94 views
2

我想通過udp流.ts文件,因爲我使用了下面的管道。Streaming .ts通過UDP文件

但在一秒鐘內它到達EOS

GST_DEBUG=3 gst-launch-1.0 -v filesrc location=avm.ts ! queue ! tsparse ! rtpmp2tpay ! udpsink host=192.168.1.139 port=8080 

Setting pipeline to PLAYING ... 
New clock: GstSystemClock 
Got EOS from element "pipeline0". 
Execution ended after 0:00:00.177011430 

在接收端我不能夠接受完整的數據,只有前幾幀在發送端,因爲即時退出來了。

同時流式傳輸一個.ts文件,其中包含視頻&文本數據,在接收端只能獲取文本數據。

在調試消息的下方發送結束。

0:00:00.030345526 7863  0xd9df60 WARN     basesrc gstbasesrc.c:3483:gst_base_src_start_complete:<filesrc0> pad not activated yet 
Pipeline is PREROLLING ... 
/GstPipeline:pipeline0/MpegTsMux:mpegtsmux0.GstPad:sink_65: caps = "application/x-metadata\,\ standard\=\(string\)klv" 
0:00:00.031289005 7863  0xd710f0 FIXME    basesink gstbasesink.c:3064:gst_base_sink_default_event:<udpsink0> stream-start event without group-id. Consider implementing group-id handling in the upstream elements 

當我改變了管道,並添加身份一樣,

gst-launch-1.0 filesrc location=vfpd.ts ! queue ! tsparse ! rtpmp2tpay ! identity silent=false ! udpsink -v host=192.168.1.139 port=8765 

然後收到太多郵件,就像下面,

/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (1328 bytes, dts: none, pts:none, duration: none, offset: -1, offset_end: -1, flags: 00004000 tag-memory) 0x7fcaf40abac0 
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (200 bytes, dts: none, pts:none, duration: none, offset: -1, offset_end: -1, flags: 00004000 tag-memory) 0x7fcaf40abdf0 
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (1328 bytes, dts: none, pts:none, duration: none, offset: -1, offset_end: -1, flags: 00004000 tag-memory) 0x7fcaf40db7f0 
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (1328 bytes, dts: none, pts:none, duration: none, offset: -1, offset_end: -1, flags: 00004000 tag-memory) 0x7fcaf409d450 
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (1328 bytes, dts: none, pts:none, duration: none, offset: -1, offset_end: -1, flags: 00004000 tag-memory) 0x7fcaf4007460 
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (200 bytes, dts: none, pts:none, duration: none, offset: -1, offset_end: -1, flags: 00004000 tag-memory) 0x7fcaf40bfc10 
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (1328 bytes, dts: none, pts:none, duration: none, offset: -1, offset_end: -1, flags: 00004000 tag-memory) 0x7fcaf408f000 
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (1328 bytes, dts: none, pts:none, duration: none, offset: -1, offset_end: -1, flags: 00004000 tag-memory) 0x7fcaf409d560 
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (952 bytes, dts: none, pts:none, duration: none, offset: -1, offset_end: -1, flags: 00004000 tag-memory) 0x7fcaf408f330 
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = event ******* (identity0:sink) E (type: eos (28174),) 0x7fcaf4003400 

所以,我的理解,它是在單個實例中發送所有數據包,這意味着無需流量控制。

該文件是25幀/秒。而且我怎樣才能以相同的流量輸出ts?

那個警告是什麼意思?以及如何解決它? 如何解決此問題?我怎樣才能減慢流量?

+0

與同步參數可能起於沉.. – nayana

+0

不給任何改善,沒有發生任何變化 –

+0

然後檢查日誌,發現一些有趣的東西,把它放在這裏 – nayana

回答

0

我已經使用下面的管道,這解決了我的問題。

GST_DEBUG=3 gst-launch-1.0 -v filesrc location=avm.ts ! queue ! tsdemux ! mpegtsmux ! rtpmp2tpay ! udpsink host=192.168.1.139 port=8080 
+0

不要忘記接受它作爲正確的答案(灰色勾選下面的答案分數) – nayana

1

首先 - 管道看起來不錯,我..

從您的更新:

那麼它看起來像我預期它會在一個突發(因爲你已經說過),問題在你原來的流中,幀內沒有時間信息(那些對於dts,pts和持續時間沒有時間信息)..有兩種可能的解釋 - 你的.ts文件存在一些問題..或者gstreamer管道中存在問題..

個性我認爲你的.ts文件錯誤..

爲了消除第一個我會建議分析的.ts一些MPEG analyzato​​r文件..

你應該檢查MPEG TS流不包含正確PCR值是同步mpeg流的信息。

UPDATE:

確定後黑客,我發現這個解決方案的一點,我希望它工作在reciever網站,我測試只是流它,它運行原ts file長度:

gst-launch-1.0 filesrc location=football.ts ! queue ! tsparse set-timestamps=true ! rtpmp2tpay ! udpsink -v host=192.168.1.139 port=8765 

set-timestamps正確標記具有時間信息的緩衝區。

+0

如果.TS文件是錯誤的,那麼它爲什麼通過使用playbin播放得很好。即使當我使用這個管道時,gst-launch-1.0 filesrc location = vfpd.ts! tsdemux! h264parse! avdec_h264! videoconvert! xvimagesink。 –

+0

我確信ts文件已經很好地創建了,並且它的解碼能力很好 –

+0

如果你在tsdemux之後放置標識會發生什麼?也許有tsparse – nayana