I'm using ffmpeg to record RTSP MPEG4 stream from camera
- RTSP has been established by calling avformat_open_input function
- Frame is received from the camera with
av_read_packet
(contest, &packet) and it is stored in AVPacket structure. - Now I want to parse this frame to determine which is I frame before it is stored to file.
Using
avcodec_decode_video
func which might help me in this case but because there is a delay decoding so it is not good choise for me. Anyway, I want to use another way
Simply I think packet.data contains a RTP format which includes RTP header + RTP data.
I've looked into some other theads such as: how to process draw data packet and parsing MPEG-4 from rtp packet. Actually they look very close what I need and maybe I did something wrong.Therefore, I still cannot figure out where is 12 bytes for RTP header in packet.data and then what I realy need is I, P or B video object plane info.
Trying to parse the RTP format but it seems packet.data either contains some extra information more than a pure RTP format or doesn't contain RTP header. I'm not sure.
Shotly:
How can I parse the frame to get frame info (I, P or B) in AVPacket