[Live-devel] Decoding h264 from an RTSP stream

Jens Binder jens.binder at hhi.fraunhofer.de
Fri Aug 20 04:27:37 PDT 2010


Hej Estelle

> Using your live555 libraries and ffmpeg, I am trying to write an h264
> player that uses RTSP. Although I successfully seem to be receiving
> the RTP packets, they are not being decoded. In researching this problem
> I have noticed the following:
>
> ffmpeg h264 decoder seems to be looking for 001

0x000001 is the start code for any H.264 NAL unit!

>
> When stepping through mplayer code, it finds this 001.
> When I look at the stream with Wireshark, I do not see a 001.
>

The start units are not transmitted via RTP. The marker bit indicates, 
that a NAL-unit is finished - then your client has to add the start code 
to the currently received frame

> My program that uses live555 and ffmpeg can't find 001 in the frame.
>
> Questions:
>
> Is the live555 library adding this 001 and if so where and how do I tell
> it to do it?

afterGettingFrame1() function in your Client - most probably a subclass 
of MediaSink

take a deeper look into RFC3984 for H.264 over RTP and the H.264 
specification itself which answers most of you questions:
http://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.264-201003-I!!PDF-E&type=items

jens.



More information about the live-devel mailing list