extract multiple elementary streams using one tsdemux element?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

extract multiple elementary streams using one tsdemux element?

Adams, Bruce (KMLWG)

Hi,

     I’m trying to extract multiple elementary streams (belonging to different programs) from a transport stream simultaneously.

Currently I can only get this to work by adding a tee element and connecting a separate tsdemux for each program. Is this the only way? It seems an unnecessary complication.

 

If I run a pipeline like:

 

GST_DEBUG=6 gst-launch-1.0 -v filesrc location=foo.ts ! tsdemux name=demux  demux.audio_0_006a ! mpegaudioparse ! mpg123audiodec ! audioresample ! audio/x-raw, rate=8000 ! wavenc ! filesink location=audio1.wav 2>&1 | grep "creating pad" | grep audio | tee audiopads

 

It looks like the tsdemux element provides pads for all the audio streams:

 

GST_DEBUG=6 gst-launch-1.0 -v filesrc location=foo.ts ! tsdemux name=demux  demux.audio_0_006a ! mpegaudioparse ! mpg123audiodec ! audioresample ! audio/x-raw, rate=8000 ! wavenc ! filesink location=audio1.wav 2>&1 | grep "creating pad" | grep audio | tee audiopads2

0:00:01.284886317 28409 0x5643c2334320 LOG                  tsdemux tsdemux.c:1594:create_pad_for_stream: stream:0x7fae8c00cd00 creating pad with name audio_0_0066 and caps audio/mpeg, mpegversion=(int)1

0:00:01.285548634 28409 0x5643c2334320 LOG                  tsdemux tsdemux.c:1594:create_pad_for_stream: stream:0x7fae8c00ef10 creating pad with name audio_0_006a and caps audio/mpeg, mpegversion=(int)1

0:00:01.295740367 28409 0x5643c2334320 LOG                  tsdemux tsdemux.c:1594:create_pad_for_stream: stream:0x7fae8c09eb80 creating pad with name audio_1_00ca and caps audio/mpeg, mpegversion=(int)1

[snip]

0:00:01.316647548 28409 0x5643c2334320 LOG                  tsdemux tsdemux.c:1594:create_pad_for_stream: stream:0x7fae8c0b5400 creating pad with name audio_1_0044 and caps audio/mpeg, mpegversion=(int)1

 

So it looks like a single tsdemux can be used to get at all the elementary streams.

However, when I try to do this programmatically I find I only get the elementary streams

for a single program as if the program_number property is set (explicitly setting it to -1 does not help).

 

Similarly from the command line I’d like to do something like:

 

gst-launch-1.0 -v filesrc location=foo.ts ! tsdemux name=demux \

demux.audio_0_0066 ! queue ! mpegaudioparse ! mpg123audiodec ! audioresample ! audio/x-raw, rate=8000 ! wavenc ! filesink location=audio1.wav \

demux.audio_1_00ca ! queue ! mpegaudioparse ! mpg123audiodec ! audioresample ! audio/x-raw, rate=8000 ! wavenc ! filesink location=audio2.wav

 

Which fails as follows:

 

WARNING: from element /GstPipeline:pipeline0/GstTSDemux:demux: Delayed linking failed.

Additional debug info:

./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstTSDemux:demux:

failed delayed linking pad  audio_1_00ca of GstTSDemux named demux to some pad of GstQueue named queue1

 

Regards,

 

Bruce.

 



Kantar Disclaimer
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: extract multiple elementary streams using one tsdemux element?

Baby Octopus
Administrator
In the current implementation, tsdemux element demuxes only the elementary
streams of the configured program through program-number property.

I also remember a request some time back on demuxing through PID rather than
specifying program number, in which case it should be possible to do that.
Such a change is not impossible but will involve good amount of design and
code changes. You can file a bug and post a patch for the same. Anybody else
working on it looks unlikely, since what you want can be achieved by using
tee and multiple demuxer as you have quoted(though suboptimal)



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel