[FFmpeg-devel] [PATCH]lavc/mpeg12dec: Read Closed Captions from second field

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Nov 30 17:52:27 EET 2018


2018-11-29 18:59 GMT+01:00, Devin Heitmueller <dheitmueller at kernellabs.com>:
> On Thu, Nov 29, 2018 at 12:55 PM Michael Niedermayer
> <michael at niedermayer.cc> wrote:
>
>> > +        if (s1->a53_caption) {
>> > +            AVFrameSideData *sd;
>> > +            av_frame_remove_side_data(s->current_picture_ptr->f,
>> > AV_FRAME_DATA_A53_CC);
>> > +            sd = av_frame_new_side_data(
>> > +                s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC,
>> > +                s1->a53_caption_size);
>> > +            if (sd)
>> > +                memcpy(sd->data, s1->a53_caption,
>> > s1->a53_caption_size);
>> > +            av_freep(&s1->a53_caption);
>> > +        }
>>
>> This is probably ok if only one field has data Attached to it, but if both
>> have then both should be exported. Also the user should have some way to
>> find out which of 2 fields data came from
>
> Yeah, this will cause the captions from the first field to get lost.
> It probably makes sense to look at the H.264 decoder, where this is
> done properly (i.e. creating a side data that contains the captions
> from both fields).

Could you provide a sample for me for testing?

Thank you, Carl Eugen


More information about the ffmpeg-devel mailing list