[FFmpeg-devel] [PATCH] avcodec/h264, videotoolbox: handle streams with multiple/changing PPS

wm4 nfxjfg at googlemail.com
Wed Feb 15 08:04:25 EET 2017

On Wed, 15 Feb 2017 05:33:38 +0000
Aman Gupta <ffmpeg at tmm1.net> wrote:

> On Tue, Feb 14, 2017 at 5:14 PM Aman Gupta <ffmpeg at tmm1.net> wrote:
> > From: Aman Gupta <aman at tmm1.net>
> >
> > The videotoolbox hwaccel only receives SLICE and IDR_SLICE NALUs. This
> > works fine most of the time, but some streams fail to decode because
> > changes in PPS are not propagated to the VT decoder.  
> Perhaps SPS can change mid-stream, and should be passed into the VT decoder
> as well? I'm not familiar enough with h264 to know.

Yes, it can. In theory, it should work, because a SPS/PPS change (in a
slice) will trigger a configuration change and reinit the hwaccel (so
ff_videotoolbox_avcc_extradata_create() will be called and update with
the new SPS). But there's some partial change-detection, which prevents
reconfiguration changes if the sw decoder doesn't need them, so this is
imperfect. (Also assumes slices can reference only 1 SPS and 1 PPS,
which is probably true.)

More information about the ffmpeg-devel mailing list