[FFmpeg-devel] Decoding H264 / RTP with ffmpeg

Sergio Arroutbi sarroutbi
Thu Nov 11 15:20:05 CET 2010


I am trying to decode images coming from a H264 Axis camera.

This camera is sending H.264 stream based on some information provided 
in SDP (sent via 200 Ok responses to RTSP DESCRIBE messages).

After sending RTSP requests, I start receiving the stream.

Once the stream is received, I dont know how to parse the RTP messages 
in order to be able to decode the

What i have is basically a socket that reads the RTP packets, get RTP 
payload and calls:

avcodec_decode_video(*context, *decoded_image, &got_picture, frame, 
frame_size)), where "frame" and "frame_size" are the RTP payload and RTP 
payload length. I continously get the error:

[h264 @ 0x99b7a20]no frame!

After investigating the issue, I guess that I have to parse  RTP payload 
in order to get "raw H264 frames". I discovered RFC3984 (that talks 
about this topic), but I believe ffmpeg library does already perform 
"RFC3984 performance", as it has some methods to parse the sdp, RTP, etc.

Which is the best method to decode the frames by calling 

I guess I have to pass SDP information to AVContext*, but do not know 
how to do so.

Anyone could perform decoding of frames in a H.264 stream encapsulated 
in RTP?

Which is the best method to use?

Thanks a lot.


Sergio Arroutbi Braojos
Ingeniero de Desarrollo Software
Grupo GMIS

More information about the ffmpeg-devel mailing list