souphttpsrc and mpeg-ts paket size

Krzysztof Konopko krzysztof.konopko at konagma.eu
Fri Aug 23 13:54:09 UTC 2019


On Fri, 2019-08-23 at 13:32 +0000, Patrick Fischer wrote:
> Hello list
> 
> I have a souphttpsrc -> queue -> typefind -> ownElement
> 
> i have the problem that i have an element of my own that wants to
> process mpegts packets.
> Unfortunately the http payload is not a multiple of 188 and therefore
> my
> element gets problems processing it.
> Is there a way I can tell the souphttpsrc element to always query a
> multiple of 188 bytes?
> Or a way to tell the queue that it should always pass a multiple of
> 188
> bytes?
> 
> Alternatively I have to keep a buffer in my element and manage it
> myself. But I would prefer a general solution.
> 

I don't think that there can be a general solution to this as the
correct approach is to look for TS sync bytes.  A hypothetical element
could provide you buffers aligned to 188 bytes but what if for some
reason (errors in transit) they did not start with TS sync byte?

Typically elements consuming TS byte stream have to use a buffer (for
example based on `GstAdapter`) and look up sync bytes first (which can
be crude and work in most of the cases but is not trivial to make it
robust).

Maybe there are other options, like asking 'tsparse' to output aligned
and properly sync-ed buffers.  It does already all of the above
(although not employing super-robust sync byte detection mechanisms)
but AFAICT the output is still the same as input, ie. not aligned. 
Maybe adding an option to 'tsparse' could make sense?

Kris



More information about the gstreamer-devel mailing list