[Live-devel] RFC4175 uncompressed video streaming: variable payload header length

Marco Porsch m.porsch at intenta.de
Thu Jul 24 09:34:25 PDT 2014


Hello,

I am currently trying to implement uncompressed video streaming according to RFC4175. An issue that I struggle with, is that the payload header is variable in length (see [1]). The header length depends on packet size, image line length and current fragmentation offset. (I use some simplifications concerning color sampling for now. Also the payload header is not yet evaluated except for the continuation flag.)

I can calculate the header length and write the header accordingly in my subclass' doSpecialFrameHandling() function that calls setSpecialHeaderBytes(). But on the receiver side I always see image line offset artefacts, i.e. one or multiple lines shifted left/right.
The receiver code should be alright, as it just looks for the "continuation" flag to determine the header length and skips the header by setting "resultSpecialHeaderSize" accordingly.

The issue seems to be in the order of events concerning doSpecialFrameHandling() and specialHeaderSize(). My subclass' specialHeaderSize() is called called from MultiFramedRTPSink.cpp before the header is written in my doSpecialFrameHandling(). Thus, it seems I have to predict the header size one fragment ahead? But in that case I do not yet know how large "numBytesInFrame" is, which seems to change depending on my previously written header sizes...

I also tried using setFrameSpecificHeaderBytes() and frameSpecificHeaderSize(), but the result was just a totally garbled and twisted image on the receiver side.

Yes, this is all a bit confusing. Maybe I am just doing something totally wrong. Maybe you could clarify on how to cope with variable per-frame payload header lengths at all?

Cheers,
Marco Porsch

[1]
http://tools.ietf.org/html/rfc4175

PS: Please let's not have a discussion on the craziness of uncompressed video streaming in high resolution. I am aware that it is. =)



More information about the live-devel mailing list