How to read H264 SPS & PPS NAL bytes using libavformat APIs?
I tried reading video data to 'AVPacket' structure using "av_read_frame(input_avFormatContext, &avPkt)" API, from a .mp4 video (codec is h264) file.
I dumped avPkt->data to a file. But 1st frame read is an IDR frame.
File generated using "ffmpeg -i video.mp4 video.h264" will contain SPS & PPS in the starting before start of IDR.
I want to extract raw .h264 video from .mp4 file and dump it in SPS,PPS, IDR, P1, P2... order.
I want to get this done programmatically using libavformat APIs.
Any idea on it?
Thanks.