[FFmpeg-devel] Fix x264 SEI offset

Jack Waller ffmpeg at gmail.com
Mon Jul 26 15:11:51 EEST 2021


Oops

Sent wrong patch, Please use the following:

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 9afaf19547..f78365a4f7 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -936,7 +936,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
         for (i = 0; i < nnal; i++) {
             /* Don't put the SEI in extradata. */
             if (nal[i].i_type == NAL_SEI) {
-                av_log(avctx, AV_LOG_INFO, "%s\n", nal[i].p_payload+25);
+                av_log(avctx, AV_LOG_INFO, "%s\n", nal[i].p_payload+24);
                 x4->sei_size = nal[i].i_payload;
                 x4->sei      = av_malloc(x4->sei_size);
                 if (!x4->sei)



On Mon, Jul 26, 2021 at 8:09 PM Jack Waller <ffmpeg at gmail.com> wrote:

> Dear:
>
> The libavcodec/libx264.c uses the wrong offset to obtain the SEI
>
> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> index f78365a4f7..9afaf19547 100644
> --- a/libavcodec/libx264.c
> +++ b/libavcodec/libx264.c
> @@ -936,7 +936,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
>          for (i = 0; i < nnal; i++) {
>              /* Don't put the SEI in extradata. */
>              if (nal[i].i_type == NAL_SEI) {
> -                av_log(avctx, AV_LOG_INFO, "%s\n", nal[i].p_payload+24);
> +                av_log(avctx, AV_LOG_INFO, "%s\n", nal[i].p_payload+25);
>                  x4->sei_size = nal[i].i_payload;
>                  x4->sei      = av_malloc(x4->sei_size);
>                  if (!x4->sei)
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_x264_SEI_offset_2.diff
Type: application/octet-stream
Size: 639 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210726/8e3a6aa4/attachment.obj>


More information about the ffmpeg-devel mailing list