[Ffmpeg-devel] Split H 263 frame at GOB boundaries for RTP

Richard van der Hoff richardv
Wed Sep 7 12:16:59 CEST 2005


bagwan ali wrote:
> Hi,
> 
> I am trying to stream H 263 over RTP.
> 
> I use ffmpeg 4.9.0 pre1 for H 263 encoding and
> jrtplib v3.1.0(http://research.edm.luc.ac.be/jori/jrtplib/jrtplib.html) 
> for rtp streaming.
> 
> The whole testlab setup is as follows:
> 
> Grabber/RTP streamer -> darwin streamserver v1.5.5  -> quicktime player 
> v6.5.2
> 
> So far I am streaming QCIF(=176x144) H 263 at 50kbit/sec over UDP/RTP 
> successfully
> but only if ONE H 263 frame fits completly in the payload of ONE RTP 
> packet.
> In my case the MTU (Maximum Transmission Unit) is 1450 bytes,
> so the maximum RTP payload size is around 1398 bytes.
> 
> Now I red somewhere on the internet that if a H 263 frame is too large 
> to fit in ONE RTP packet,
> I have to split the H 263 frame at GOB(Group of Block) or MB(Macroblock) 
> boundaries, I prefer to do it at GOB boundaries.

That's probably easiest, yes, as you can then use only type A RTP packets.

> And in my case an QCIF H263 I(ntra) Frame has 9 GOBs in total.

*up to* 9 - there's no requirement to use them all.

> So if I am correct, the start of a GOB frame begins with a GBSC (Group 
> of Blocks Start Code),
> which is an 17-bit word with the binary value 0000 0000 0000 0000 1. 

correct; however, watch out for the end-of-picture code which is 0000 
0000 0000 0000 1111 11 iirc.

> This value is ALWAYS byte-aligned.

Not necessarily - that's why the RTP framing format allows you to 
specify bit-offsets. libavcodec's h263 encoder does byte-align them, 
however.

> So I should at least find 8 times a hexadecimal value starting with 
> 0000. Not 9 times because
> for GOB number 0 in each frame, no GOB header is encoded.

as I said, there's no requirement to split your picture into the full 9 
GOBs.

> But the problem is that I cannot find the start of those GOB's in an 
> H263 encoded I Frame.

You need to tell ffmpeg to split your picture into GOBs. Try -ps 1000.

HTH

Richard

-- 
Richard van der Hoff <richardv at mxtelecom.com>
Systems Analyst
Tel: +44 (0) 845 666 7778
http://www.mxtelecom.com





More information about the ffmpeg-devel mailing list