[Libav-user] How to set PPS manually

Carl Eugen Hoyos ceffmpeg at gmail.com
Mon May 20 13:27:55 EEST 2019


Am Do., 16. Mai 2019 um 11:51 Uhr schrieb Michael Bachmann
<Michael.Bachmann at picsystems.ch>:

> I’m reverse engineering a DVR-Video-Format and was able to extract the
> h264-bytestream. The h264-bytestream does only contain IDR_SLICE,
> SEI and SLICE NAL-Units. So there are no SPS and PPS NAL-Units
> before each IDR_SLICE (which corresponds to AVCC scheme). I’m still
> searching for the SPS and PPS part in the DVR-Video-Format.
>
> Feeding libav with this bytestream leads to the following error output:
>
> non-existing PPS 0 referenced
>
> decode_slice_header error
>
> non-existing PPS 0 referenced
>
> decode_slice_header error
>
> no frame!
>
>
>
> Which is logical, cause the decoder can’t find any PPS NAL-Units in the bytestream.
>
> So how can I set PPS manually on the AVCodecContext, so the decoder is able to decode the bytestream?

Do you already know how the pps is supposed to look like?
If not, you can hardcode whatever is needed into FFmpeg code or put the
necessary information in front of the first frame.

Once you know, look at ff_generate_avci_extradata() in libavformat/utils.c

Carl Eugen


More information about the Libav-user mailing list