On 02/21/2012 05:17 PM, Anton Khirnov wrote:

> 
> On Mon, 20 Feb 2012 17:02:17 -0500, Justin Ruggles <[email protected]> 
> wrote:
>> ---
>>  libavcodec/avcodec.h |   13 +++++++++++--
>>  1 files changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> index 7128a83..3688f83 100644
>> --- a/libavcodec/avcodec.h
>> +++ b/libavcodec/avcodec.h
>> @@ -1315,8 +1315,17 @@ typedef struct AVCodecContext {
>>      int frame_number;   ///< audio or video frame number
>>  
>>      /**
>> -     * Number of frames the decoded output will be delayed relative to
>> -     * the encoded input.
>> +     * Encoder delay.
>> +     *
>> +     * Video:
>> +     *   Number of frames the decoded output will be delayed relative to the
>> +     *   encoded input.
>> +     *
>> +     * Audio:
>> +     *   Number of "priming" samples added to the beginning of the stream
>> +     *   during encoding. The decoded output will be delayed by this many
>> +     *   samples relative to the input to the encoder.
>> +     *
>>       * - encoding: Set by libavcodec.
>>       * - decoding: unused
>>       */
>> -- 
>> 1.7.1
>>
> 
> Maybe you could clarify what does this mean for pts. If i understand the
> second patch correctly, the pts of the first output packet will be
> shifted wrt pts of the first input frame, right?


Ok, I can clarify that. This does not affect pts, per-se. The pts is
still supposed to be the correct value regardless, which indeed may be
shifted for delay added by the encoder. This field provides a way of
telling the muxer how much encoder delay there is, and it just happens
to also be useful for calculating pts in the encoder. We could've used
an internal field for that if it wasn't also useful to export.

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to