[FFmpeg-devel] [PATCH] libx265: support ATSC A/53 captions

Eran Kornblau eran.kornblau at kaltura.com
Tue Nov 8 16:25:40 EET 2022


> 
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Timo Rothenpieler
> Sent: Tuesday, 8 November 2022 13:33
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH] libx265: support ATSC A/53 captions
> 
> >
> > The attached patch adds rendering of ATSC A/53 captions as HEVC SEI messages.
> > The option name/implementation is aligned with the corresponding libx264 feature.
> 
> What frees the sei data on success?
> 
Thanks Timo, good point! 

I missed the fact that libx264 gets a callback for freeing the SEI payloads (sei_free).
It seems libx265 does not have this option, so I added some 'for' loop to free the payloads after the call to encoder_encode.

In addition:
1. I added av_memdup on the 'user-data-unregistered' side data so that it won't be freed twice.
2. I added a 'free_picture' function for freeing the x265_picture in case of error.
(both changes are aligned with the implementation in libx264.c)

Updated patch attached.

While checking the point you raised, I ran some libx265 transcode with valgrind, and it reported errors unrelated to this patch.
Attaching the full output, in case anyone wants to have a look.

Thanks!

Eran

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libx265-support-ATSC-A-53-captions.patch
Type: application/octet-stream
Size: 6855 bytes
Desc: 0001-libx265-support-ATSC-A-53-captions.patch
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20221108/4ad5712b/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libx265-valgrind.txt
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20221108/4ad5712b/attachment.txt>


More information about the ffmpeg-devel mailing list