[gst-devel] typefind and modifying a running stream (python bindings)

Tim Müller t.i.m at zen.co.uk
Tue Sep 11 00:34:09 CEST 2007


On Mon, 2007-09-10 at 11:34 -0400, Daniel Lenski wrote:

> * Are there any subtleties to modifying a running pipeline?  When I
> pause the pipeline, append to it, and then unpause it, should I be
> worried about data getting lost, or buffer overflows, or anything like
> that?  This doesn't seem to be a problem, but maybe I've just got
> lucky.

Yes, there are a few issues here.  Basically, you need to look at things
from the streaming thread's perspective (which is: if you don't do your
stuff in the streaming thread, it will either error out with a
not-linked flow error, or the pipeline will preroll if there's a sink,
but then you'll lose data if you replace the sink with some other
element).  This means you don't rely on things like pipeline pausing,
but you do everything in signal callbacks like new-decoded-pad,
pad-added, type-found etc.  Otherwise you need to do pad blocking to
avoid data loss.



> * Typefind identifies MP3 files as application/id3 sometimes, rather
> than audio/mpeg.  Is there a more correct and reliable way to identify
> an MP3 stream?

application/x-id3, hopefully :)  The only correct way to identify an mp3
stream via typefinding is to check for "audio/mpeg, mpegversion=1,
layer=3".  Any file can have an ID3 tag, and it's not that uncommon to
find ID3-tagged .wav or .flac files.  Some files may even have multiple
ID3 tags, or nested ID3/APE tags.

 Cheers
  -Tim






More information about the gstreamer-devel mailing list