[gst-devel] Implementing a MPEGTS segmenter, what's the best approach?

Andoni Morales ylatuya at gmail.com
Sun Jan 2 22:54:48 CET 2011


2010/12/31 David Zhao <david at davidzhao.com>:
> Thanks David! That's exactly what I was looking for.
>
> On Thu, Dec 30, 2010 at 11:23 PM, David Schleef <ds at entropywave.com> wrote:
>>
>> On Thu, Dec 30, 2010 at 08:35:21PM -0800, David Zhao wrote:
>> > Hello,
>> >
>> > I'm trying to build a GStreamer plugin that would produce segments of
>> > MPEGTS
>> > files, each with a fixed duration. This is to create TS segments for the
>> > Apple HTTP live streaming protocol. I'm fairly new to developing for
>> > GStreamer and have a basic understanding of how it works.
>> >
>> > The approach I had in mind is to create a plugin that includes both
>> > mpegtsmux and filesink. Within that plugin, it could produce individual
>> > ts
>> > files when certain duration is accumulated.
>> >
>> > Is this feasible? Is there another way to do this without having to
>> > replicate code that's already in mpegtsmux and filesink?
>>
>> gst-launch ... ! mpegtsmux ! multifilesink next-file=key-frame \
>>    location=%05d.ts

That's probably the quickest way to produce segments for testing
purpose but these fragments wouldn't follow the spec's
recommendations[1].

" Transport Stream files MUST contain a single MPEG-2 Program.  There
   SHOULD be a Program Association Table and a Program Map Table at the
   start of each file.  A file that contains video SHOULD have at least
   one key frame and enough information to completely initialize a video
   decoder."

A client can join the stream at any moment (downloading any of the
available segments), so each segment must be independently decodable,
which means you need to start each fragment with a PAT table, followed
with a PMT table and starting with a keyframe.

Andoni

[1]http://tools.ietf.org/html/draft-pantos-http-live-streaming-05#page-4
>>
>>
>>
>> David
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
>> to consolidate database storage, standardize their database environment,
>> and,
>> should the need arise, upgrade to a full multi-node Oracle RAC database
>> without downtime or disruption
>> http://p.sf.net/sfu/oracle-sfdevnl
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment,
> and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>



-- 
Andoni Morales Alastruey

LongoMatch:The Digital Coach
http://www.longomatch.ylatuya.es




More information about the gstreamer-devel mailing list