通过UDP流式传输.ts文件

时间:2016-05-13 06:35:45

标签: udp streaming gstreamer mpeg

我想通过udp传输.ts文件,因为我使用了下面的管道。

但是在一秒之内就达到了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

在接收端,我无法接收整个数据,因为发送端即时退出,只有前几帧即将到来。

Streaming一个包含视频&amp ;;的文件。文本数据,仅在接收端获取,文本数据。

在发送结束时,调试消息来了。

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 fps。我怎么能以相同的流速流式传输ts?

该警告意味着什么?以及如何解决? 如何解决这个问题?我怎样才能减慢流量?

2 个答案:

答案 0 :(得分:1)

首先 - 管道对我来说很好..

来自您的更新:

好吧它看起来就像我预期的那样在一个爆发中(正如你已经说过的那样),问题是在原始流中没有帧内的定时信息(那些没有dts,pts和持续时间)..有两种可能的解释 - .ts文件中存在一些问题..或者gstreamer管道存在问题..

Personaly我认为你的.ts文件错了..

为了消除第一个,我建议用一些mpeg analyzato​​r分析.ts文件..

您应该检查mpeg ts流是否包含正确的PCR值,这些值是mpeg流的同步信息。

更新:

好吧,经过一点点黑客攻击后我找到了这个解决方案,我希望它可以在接收站点上运行,我测试的只是为了流式传输而且它运行的时间长度为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正确地用时间信息标记缓冲区..

答案 1 :(得分: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
相关问题