Hello

I am currently decoding h264 streams (with libavcodec) and I am stuck with the logic for SPS (sequence parameter set) and PPS (picture parameter set). The board from which I am receiving the packages is sending a NAL unit in each packet. The sequence for NAL types is:
7(SPS) 8(PPS) 5 1 1 1 1 7 8 5 1 1 1...
I am putting in front of each NAL the start sequence 0x000001 and sending this packet to avcodec_decode_video2. When 7 and 8 types are coming, I am doing the same logic, but avcodec_decode_video2 is returning -1. After this, all the received NALs are decoded and the images are displayed. Every time when SPS and PPS are coming, avcodec_decode_video2 returns -1 (fails). I searched all over the net , and I still can't understand how to fill up the extradata and extradata_size from AVCodecContext used. All I found is this link: http://www.mail-archive.com/[email protected]/msg04939.html. As I saw from here: "To decode H.264 stream you need to have SPS and PPS NAL units also .". Ok, I have them, but frankly I don't know how to use them. At first, I thought that avcodec_decode_video2 will "automatically" use them. But returning -1, I don't see how. Also, If I am discarding SPS and PPS from sending them to libavcodec, nothing is decoded anymore.
Can you please give me a hint?
Thank you a lot !
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to