Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

errors when decode H.264 frames using ffmpeg

Tags:

ffmpeg

h.264

I am getting the following errors when decoding H.264 frames received from the remote end of a H.264 based SIP video call. Appreciate any help in understanding there errors.

non-existing PPS 0 referenced decode_slice_header error non-existing PPS 0 referenced decode_slice_header error no frame!  non-existing PPS 0 referenced decode_slice_header error non-existing PPS 0 referenced decode_slice_header error no frame! 
like image 950
John Qualis Avatar asked Feb 21 '13 15:02

John Qualis


2 Answers

That just means that ffmpeg has not seen a keyframe yet, which carries SPS and PPS information. SPS and PPS are crucial in decoding an incoming frame/slice. Keyframes are sent periodically(i.e. every 5-10 seconds or more); so if turns out that you joined a stream before the keyframe arrived; you will see this warning for every frame until a keyframe shows up.

As soon as the keyframe shows up from the wire, ffmpeg will have enough information to decode that frame(and any subsequent frames until the next keyframe), so those warnings will go away.

like image 55
Aki Avatar answered Sep 19 '22 04:09

Aki


you need to add frames sps and pps information. ffmpeg needs these information to make decoding. You can find these values in SDP file.

In SDP file, you should look NAL units, you can see something like that z0IAHukCwS1xIADbugAzf5GdyGQl, aM4xUg

these values based64 encoded you should convert it to hex format. I am using wireshark and wireshark converts itself these values for you. After that you have sps and pps values.

Now you have to add these Nal information before data frame.

00 00 00 01 sps 00 00 00 01 pps 00 00 00 01 data

for h264 these format i have been using to decode.

like image 26
Sirdavos Avatar answered Sep 21 '22 04:09

Sirdavos