[FFmpeg-devel] [PATCH] avcodec/qtrle: set pict type information in ouptut frames

Paul B Mahol onemda at gmail.com
Thu Aug 29 19:56:32 EEST 2019


On 8/29/19, James Almer <jamrial at gmail.com> wrote:
> On 8/29/2019 1:18 PM, Paul B Mahol wrote:
>> On 8/29/19, James Almer <jamrial at gmail.com> wrote:
>>> Signed-off-by: James Almer <jamrial at gmail.com>
>>> ---
>>>  libavcodec/qtrle.c | 7 +++++++
>>>  1 file changed, 7 insertions(+)
>>>
>>> diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
>>> index f565e0e358..ba6740f5d4 100644
>>> --- a/libavcodec/qtrle.c
>>> +++ b/libavcodec/qtrle.c
>>> @@ -449,6 +449,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
>>>                                AVPacket *avpkt)
>>>  {
>>>      QtrleContext *s = avctx->priv_data;
>>> +    AVFrame *frame = data;
>>>      int header, start_line;
>>>      int height, row_ptr;
>>>      int has_palette = 0;
>>> @@ -566,6 +567,12 @@ done:
>>>
>>>      if ((ret = av_frame_ref(data, s->frame)) < 0)
>>>          return ret;
>>> +    if (avpkt->flags & AV_PKT_FLAG_KEY) {
>>> +        frame->pict_type = AV_PICTURE_TYPE_I;
>>> +        frame->key_frame = 1;
>>> +    } else {
>>> +        frame->pict_type = AV_PICTURE_TYPE_P;
>>> +    }
>>>      *got_frame      = 1;
>>>
>>>      /* always report that the buffer was completely consumed */
>>> --
>>> 2.22.0
>>>
>>> _______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel at ffmpeg.org
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>>> To unsubscribe, visit link above, or email
>>> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>>
>>
>> That info might not be correct or provided at all, so you need to
>> carefully inspect
>> data to get correct keyframe flag. Should not be hard to do.
>
> What would that be, !header && start_line == 0 && end_line == height?

Nope, check input if it have skip codes.

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list