Am 12.11.2010 08:08, schrieb Sergio Arroutbi:
> Hello.
> 
> 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
> avcodec_decode_video?
> 
> 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.
> 

Hi,

you're right, ffmpeg can receive RTP streams. It also parse the
informations from rtsp / sdp.
The function you should use is av_open_input_file() with the address of
the stream , for example rtsp://www.****.com/*** .

Then ffmpeg parses the information to AVContext*. with
av_find_stream_info(). After that you can initialize the decoder , based
on the stream informations.

The rtp-payload can then read by av_read_frame() and pass do
av_decode_video.

Steffen
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to