[gst-devel] How to make typefind drop data?

Arnout Vandecappelle arnout at mind.be
Wed Oct 15 15:18:15 CEST 2008


 Hoi,

 I'm trying to push an MPEG4 stream from a JVC camera into my GStreamer 
pipeline.  However, this camera does not start the stream on a keyframe 
boundary, but just starts emitting the current P frame.  The headers are 
therefore not recognized by typefind, and typefind returns an error.

 I would now like to drop data (buffers or bytes) until typefind does 
recognize the MPEG4 stream start.  How should I implement this?  I see the 
following options:

 - In mpeg4_video_type_find(), be less picky about the start codes, i.e. 
accept an isolated B-frame start code as well.
 - Make mpeg4_video_type_find() look ahead more, cfr. 
mpeg_video_stream_type_find().
 - In typefindelement, when typefind fails, drop a buffer (or a byte) and 
retry.
 - Same as above but from application instead of typefindelement.  Complex to 
implement.

 The first two cases don't actually skip over the unrecognized part.  This 
happens to be OK for the MPEG4 decoder, but results in some leading garbage 
in the output (it assumes a gray reference frame).  It would be nice if it 
were possible for typefind to also indicate an offset at which it detected 
the type found, and give the application the option to skip over leading 
garbage.  That would be a major overhaul, though...

 If I get no reply, I'll implement the second option and submit it through 
bugzilla.

 Regards,
 Arnout
-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  D206 D44B 5155 DF98 550D  3F2A 2213 88AA A1C7 C933




More information about the gstreamer-devel mailing list