On Thursday 31 October 2013 01:25 PM, Edward Hervey-4 [via
<br/>GStreamer-devel] wrote:
<br/> > Hi,
<br/> >
<br/> > On Wed, 2013-10-30 at 23:46 -0700, sudipj wrote:
<br/> > > There is also a tuner which tunnels the data within kernel to hw
<br/>demuxer
<br/> > > before it is pulled in the userspace by gstreamer element dvbsrc
<br/>and pushed
<br/> > > to dvbsrc.
<br/> > >
<br/> > > This could also be helpful for multitrack files where in a user
<br/>could play a
<br/> > > particular track by just passing the stream pid. For e.g just an
<br/>english
<br/> > > audio track without actually playing all the tracks of a particular
<br/>program.
<br/> >
<br/> > playing != demuxing/decoding
<br/> >
<br/> > If you want to be able to quickly switch tracks (without waiting for
<br/> > the demuxer to start reconstructing PES, pushing out data, the decoder
<br/> > to start decoding data (or wait for a keyframe?) and finally the data
<br/> > reaching the a/v sinks) ... you'll need to have data available further
<br/> > down the pipeline (ex: the decoders could keep around the last X buffers
<br/> > or GOP without decoding them if they know they are not used, but the
<br/> > moment they are (re)activated they have data available to quickly decode
<br/> > and catch up).
<br/><br/> [SJ] At first, I am just interested in a particular a/v stream(s),
<br/>might not be required switching to another track. For eg. I want to test
<br/>a/v sync for an audio/video pair.
<br/><br/> > If you were fine with that delay, you could also do the same thing in
<br/> > user-land (temporarily ignore and avoid reconstructing the specified
<br/> > PID). Hell, that would be a few lines of code in tsdemux (but we won't
<br/> > enable it by default for reasons mentioned above).
<br/><br/> [SJ]Fair enough, not expected to be enabled by default. Only when a
<br/>user provides "requested_stream_pid(s). May be you should be allowed to
<br/>switch when you are interested in particular track(s) only.
<br/> > >
<br/> > > Its seem bit out of range, but today we use for many practical reasons.
<br/> > > Internally we do have a clone of tsdemux(stts_demux), which
<br/>actually works
<br/> > > by just accepting the PES data. But the limitation is that I cannot
<br/> > > interface with other gstreamer elements.
<br/> >
<br/> > You might want to explain what "practical reasons" you have. There are
<br/> > maybe other ways to achieve the same results.
<br/> [SJ] 1. when you introduce a custom recorder element that can
<br/>record a particular stream.
<br/> 2. Decode only video (no audio) for PIP.
<br/> >
<br/> > Also, I'm going to assume that by "just accepting the PES data", you
<br/> > mean you're using individual fd for each reconstructed PID ES streams
<br/> > and not just one stream on which all PES are interleaved.
<br/><br/> [SJ] Right, our kernel demuxer pushes a SPTS(single program
<br/>TS) rather MPTS (multiple program TS). This stream is an interleaved ES
<br/>depending on the PIDS provided to the demuxer.There is an invidual fd
<br/>for an interleaved stream, different from the one received at the input
<br/>of the kernel demuxer. (atleast the PSI sections are stripped)
<br/><br/> > >
<br/> > > Can I try to provide a solution for this in tsdemux, if you see a point
<br/> > > here. ?
<br/> >
<br/> > So, what *could* be doable would be to re-use most of the code in
<br/> > tsdemux and have an alternate "pid filtering and packet reconstruction
<br/> > done in kernel" demuxer. So the PID filtering part (i.e. what is in
<br/> > mpegtspacketizer.[ch] and the stream reconstruction part of tsdemux is
<br/> > done in kernel).
<br/> > *But* you would still need to get the PSI/SI back from the kernel for
<br/> > the demuxer to work (so it can figure out the nature of the streams).
<br/> >
<br/> [SJ] PID filtering is done in kernel demuxer , except that it
<br/>does not forward the PSI sections to the user, probably it maintains
<br/>PAT/PMT table within itself. Right, stream type is required, but
<br/>that is also taken as a user argument :).
<br/> My point here is, if user has all the bare minimum stream info
<br/>then tsdemux should not restrict the user. For the two practical
<br/>purposes I sited above(recorder and PIP).
<br/><br/> > Note also that you *would* have another issue, which is that this
<br/> > element wouldn't be accepting any data (if I understood correctly) and
<br/> > would need to be a source element .. but it can't be since it would be
<br/> > exposing multiple pads.
<br/> > Ways to circumvent this:
<br/> > * Have it cloned (i.e. source elements which only expose one stream
<br/> > from the program) => very very very ugly
<br/><br/> [SJ] No, I don't want this solution.
<br/><br/> > * Have it accept data (for example only the PAT/PMT streams) from
<br/> > dvbsrc.
<br/><br/> [SJ] This would require change in kernel demuxer, not an easy task
<br/>as they won't adapt specifically to gstreamer tsdemux.
<br/><br/> > * Have it signal upstream (with an event) to the dvbsrc which PIDs it
<br/> > is interested in (this will introduce latency though).
<br/><br/> [SJ] It is as good as providing user space arguments something like
<br/>gst-launch ! filesrc location = xxx.ts ! tsdemux vid-pid/type= 100/2,
<br/>audio-pid/type = 101/3 ! ...)
<br/> which is actually I am trying to propose.
<br/><br/> > .. or just use tsdemux as-is :)
<br/> >
<br/> > Edward
<br/> >
<br/> > P.S. I haven't mentioned the dvb clock estimation, accurate
<br/> > synchronization/timestamping and latency, that's another minefield which
<br/> > is hard to deal with if you only have a limited visibility of what's
<br/> > going on.
<br/> [SJ] I knew that, timing is one thing that also needs to be
<br/>validated. But this is next.
<br/> >
<br/> > P.S. Please please please please stop calling this a hardware demuxer.
<br/> > It's not because you do the pid filtering in the kernel that it's a
<br/> > "hardware". You might as well say that you have "TCP/IP" hardware stack,
<br/> > or a "hardware CFQ i/o scheduler" (hint: no).
<br/><br/> [SJ] Ok, I am not sure if there is a dedicated hardware for
<br/>demuxer. But only thing I know, it is tightly coupled to the the tuner
<br/>which is actually a hardware block.
<br/> >
<br/> > P.S: A smarter move would be to help provide a mmap-ringbuffer interface
<br/> > to the kernel API (like V4L2) so you can avoid memcpy (right now they
<br/> > are only read() API) when getting data from the DVB interfaces. That way
<br/> > the software demuxer would be as fast (and more flexible) as the
<br/> > hardware^Wkernel one, if not faster. Would be great if people stopped
<br/> > with this crazy belief that code in the kernel runs faster than code in
<br/> > user-land... Last time I spoke to linuxtv folks they weren't against the
<br/> > idea, it's just that nobody got round to implementing it. Removing
<br/> > 30Mb/s copies ? Absolute win, regardless of whether it's a multiplex or
<br/> > reconstructed ES streams.
<br/><br/> [SJ] Fair
<br/><br/> > P.S: Have you profiled all this ? There aren't a million different ways
<br/> > of doing filtering and packet reconstruction. The biggest performance
<br/> > hit of a ts demuxer is going to be packet reconstruction (due to the
<br/> > copying which needs to be done) and it is going to cost you the same
<br/> > whether you do it in kernel or userland.
<br/><br/> [SJ] Yes, I have done profiling mainly to know the IOs per sec.
<br/>Untill the cpu load is below 10 %, it fine. Our frontend (tuner +
<br/>demuxer) guys are pretty happy to provide a generic solution to the
<br/>customers leaving them to adapt the way it is rather vice-versa.
<br/><br/> > >
<br/> > > Sudip
<br/> > >
<br/> > >
<br/> > >
<br/> > >
<br/> > >
<br/> > > --
<br/> > > View this message in context:
<br/><a href="http://gstreamer-devel.966125.n4.nabble.com/play-stream-without-parsing-PAT-PMT-tp4662984p4663019.html" target="_top" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/play-stream-without-parsing-PAT-PMT-tp4662984p4663019.html</a><br/> > > Sent from the GStreamer-devel mailing list archive at Nabble.com.
<br/> > > _______________________________________________
<br/> > > gstreamer-devel mailing list
<br/> > > [hidden email]
<br/> > > <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_top" rel="nofollow" link="external">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br/> >
<br/> >
<br/> > _______________________________________________
<br/> > gstreamer-devel mailing list
<br/> > [hidden email]
<br/> > <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_top" rel="nofollow" link="external">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br/> >
<br/> > If you reply to this email, your message will be added to the
<br/>discussion below:
<br/> >
<br/><a href="http://gstreamer-devel.966125.n4.nabble.com/play-stream-without-parsing-PAT-PMT-tp4662984p4663022.html" target="_top" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/play-stream-without-parsing-PAT-PMT-tp4662984p4663022.html</a><br/> > To start a new topic under GStreamer-devel, email
<br/><a href="/user/SendEmail.jtp?type=node&node=4663067&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>
<br/> > To unsubscribe from play stream without parsing PAT/PMT, click here.
<br/> > NAML
<br/><br/>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/play-stream-without-parsing-PAT-PMT-tp4662984p4663067.html">Re: play stream without parsing PAT/PMT</a><br/>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/">GStreamer-devel mailing list archive</a> at Nabble.com.<br/>