[vlc-devel] [RFC PATCH 1/2] packetizer: h264: also update dec extra from pf_packetize

Francois Cartegnie fcvlcdev at free.fr
Wed Apr 22 11:19:29 CEST 2015


Le 22/04/2015 09:04, Thomas Guillem a écrit :
> 
> 
> On Tue, Apr 21, 2015, at 19:29, Francois Cartegnie wrote:
>> Le 20/04/2015 20:18, Thomas Guillem a écrit :
>>> See #14429
>>> ---
>>
>> As I understand, the PPS/SPS are changing due to segment change and
>> split encoding.
>>
>> This might happen with all adaptive streaming protocols then.
>>
>> I'm unsure why we need it as fmt_out codec extra and not in the stream.
>>
>> If the codec fails to handle new pps/sps, that should be done at decoder
>> level, no ? (if packetizer is missing, that fix will fail).
> 
> Therefore, decoder must wait for valid pps/sps in the p_block given to
> DecodeVideo ?

It must read SPS/PPS from stream, and optionally use extra from start.
If it can't that's a bug.

If that's AVCC, it needs extra data.
I think your problem is with AVCC, and HLS segment boundaries.
In that case that can't be fixed at current stream filter level.

>>
>>> +    /* Change extra only if size changes */
>>> +    if( i_new_extra == p_dec->fmt_out.i_extra )
>>> +        return 0;
>>> +
>>
>> Decoding will fail if two segments have same sps/pps size sum but
>> different sps/pps.
> 
> There is first a limitation to fix in src/input/decoder.c: the extra
> will be changed only one time, see "if( p_packetizer->fmt_out.i_extra &&
> !p_dec->fmt_in.i_extra )"
> 
> Maybe pf_packetize should return a boolean indicating if format changed.
> 

See AnnexB vs AVCC

Packetizer outputs AnnexB


Francois




More information about the vlc-devel mailing list