[PATCH] libx265: support ATSC A/53 captions
Hi, 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. Thanks Eran
Ping From: Eran Kornblau Sent: Monday, 17 October 2022 19:29 To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: [PATCH] libx265: support ATSC A/53 captions Hi, 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. Thanks Eran
Another ping… From: Eran Kornblau Sent: Monday, 17 October 2022 19:29 To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org<mailto:ffmpeg-devel@ffmpeg.org>> Subject: [PATCH] libx265: support ATSC A/53 captions Hi, 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. Thanks Eran
Trying again… From: Eran Kornblau Sent: Monday, 17 October 2022 19:29 To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org<mailto:ffmpeg-devel@ffmpeg.org>> Subject: [PATCH] libx265: support ATSC A/53 captions Hi, 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. Thanks Eran
On 08.11.2022 07:49, Eran Kornblau wrote:
Trying again…
From: Eran Kornblau Sent: Monday, 17 October 2022 19:29 To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org<mailto:ffmpeg-devel@ffmpeg.org>> Subject: [PATCH] libx265: support ATSC A/53 captions
Hi,
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?
-----Original Message----- From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Timo Rothenpieler Sent: Tuesday, 8 November 2022 13:33 To: ffmpeg-devel@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
On 08.11.2022 15:25, Eran Kornblau wrote:
-----Original Message----- From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Timo Rothenpieler Sent: Tuesday, 8 November 2022 13:33 To: ffmpeg-devel@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.
One nit: splitting the first line of free_picture() in two isn't really neccesary and makes the function a bit uglier. One small problem: libx265 now needs to select atsc_a53 in configure, analog to how libx264 and all the others do. Otherwise the file containing the a53 code might not get compiled. LGTM otherwise
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.
x265 has a bunch of issues related to SEI data. See for example https://trac.ffmpeg.org/ticket/9666#comment:1 i.e. if the number of per-frame sei data ever increases past its initial count, it'll just straight up explode.
On 08.11.2022 15:25, Eran Kornblau wrote:
-----Original Message----- From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Timo Rothenpieler Sent: Tuesday, 8 November 2022 13:33 To: ffmpeg-devel@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.
One nit: splitting the first line of free_picture() in two isn't really neccesary and makes the function a bit uglier.
Fixed
One small problem: libx265 now needs to select atsc_a53 in configure, analog to how libx264 and all the others do. Otherwise the file containing the a53 code might not get compiled.
Fixed
LGTM otherwise
Thanks! Eran
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.
x265 has a bunch of issues related to SEI data. See for example https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftrac.ffmpe...
i.e. if the number of per-frame sei data ever increases past its initial count, it'll just straight up explode. _______________________________________________
applied
participants (2)
-
Eran Kornblau -
Timo Rothenpieler