AppSource: avoid reading the whole media

gianks gianksmail at gmail.com
Thu Aug 4 13:24:12 UTC 2016


Hi all,
implementing my own multifilereader via AppSource i'm stucked trying to
avoid the need-data signal to be emitted until the EOS. 
I need to play sequences of really short files (4-6 seconds), each of them
are playbackable and of same format (mpegts). I don't understand why the
pipeline is triggering the need-data signal continously forcing me to
provide the next file repeatedly until they are finished. 

After few reads of 4096 bytes the typefind element works as expected but the
pipeline playback starts just after some files (many reads) while the
appsource proceeds up to the end as fast as possible 

I tried to set the max-bytes property to 1 MB and to set the StreamType to
AppStreamTypeStream but the source is still attempting to read all the data
instead of being pulled as needed for the live playback.

The Pipeline is the following:

APPSRC ! TYPEFIND ! QUEUE   APPSINK

The TypeFind Callback adds a demuxer and a muxer and via the new_pad
callback the correct parser is added per each individual stream with its
queue to the pipeline, connected to the the demuxer and the muxer. The muxer
is finally connected to the appsink. It becomes (video only):

APPSRC ! TYPEFIND ! QUEUE ! TSDEMUX ! H264PARSE ! QUEUE ! MPEGTSMUX ! 
APPSINK

Below the log of my app during the pipeline startup. As expected the first
read of 4Kb is enough to detect the type video/mpegts but even if the
demuxer is still detecting the two multimedia streams the need-data is
called without pause.

Thanks for the help!

<pre>
@@@@@@@@@@@@@ ASYNC @@@@@@@@@@@@
NeedData  4096  Bytes with buffer 4096
TypeFound:  "video/mpegts, systemstream=(boolean)true, packetsize=(int)188"
AfterTypeFound:  "video/mpegts, systemstream=(boolean)true,
packetsize=(int)188"
Demuxer added, waiting for pads...
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
New Pad available for:  QGst::Caps("video/x-h264,
stream-format=(string)byte-stream, alignment=(string)nal")  || 
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
New Pad available for:  QGst::Caps("audio/mpeg, mpegversion=(int)2,
stream-format=(string)adts") 
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
NeedData  4096  Bytes with buffer 4096
... ....
</pre>






--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/AppSource-avoid-reading-the-whole-media-tp4678960.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list