Using appsrc with infrequent buffers

Tim-Philipp Müller t.i.m at zen.co.uk
Tue Sep 10 08:33:23 PDT 2013


On Wed, 2013-09-11 at 03:10 +1200, Adam Goodwin wrote:

Hi,

> (sorry to keep asking for help so much :/).

Not a problem, that's what the list is for!


> I've still got my H264 streams going from cameras into a matroskamux
> (and one stream being sent over RTP). At the moment I'm working with
> only one v4l2src, because this seems to work stably for me, so there's
> only one video stream.
> 
> 
> I've now added an appsrc which I've hooked up to the a subtitle pad on
> the matroskamux. I haven't put together the subtitle retrieval at the
> playback side of things, but the appsrc seems to be working when I
> push buffers (none of my error checks come back with anything).
> 
> 
> However:
> 
> 
> My video doesn't seem to be sent over RTP unless I type a line of text
> into my application - which causes the appsrc to push a buffer (with
> the text forming a subtitle). Once I've typed a line, I start to see
> video in my RTP receiver application. However, it quickly comes to a
> stop again until I type more. So it appears the pipeline doesn't like
> it when appsrc isn't contributing.
> 
> 
> As well as this, if I play my resulting MKV in VLC, the playback is
> completely messed up. Whole sections of video are missing (or maybe
> sped up so much that they're essentially skipped), and the progress
> bar skips around all over the place. Despite this, I did see my appsrc
> subtitles displayed by VLC a few times. So it suggests to me that
> there are timing issues in the pipeline, and that it's not necessarily
> anything to do with the appsrc related stuff (although it was adding
> the appsrc that triggered these issues, which are somewhat similar to
> those I was having when a second camera is introduced). Is it possible
> that the matroskamux is having issues with multiple input streams?

The problem is likely in the muxer (or rather the GstCollectPads
functionality it uses internally). It might wait for a buffer on all
pads before continuing / doing something.

You might be able to work around this by pushing a GAP event on the
subtitle appsrc whenever you know that there won't be any subtitle data,
or when there hasn't been any sub data for the last second or so. That
should hopefully keep the muxer ticking along.

Cheers
 -Tim



More information about the gstreamer-devel mailing list