[FFmpeg-trac] #9719(undetermined:new): FFmpeg HLS output with subtitles results in segmentation fault starting from 5.x

FFmpeg trac at avcodec.org
Fri Aug 16 10:21:00 EEST 2024


#9719: FFmpeg HLS output with subtitles results in segmentation fault starting
from 5.x
-------------------------------------+-------------------------------------
             Reporter:  wout         |                    Owner:  (none)
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  git-master   |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by wout):

 The following command triggers the segmentation fault.

 You can use any input MP4 with 1 video and 1 audio + empty files for the
 VTT's.

 The video track is mapped multiple times because we cannot define multiple
 subtitles in the `var_stream_map` without a video.
 The commit mentioned in the original report causes a segmentation fault
 because of this. Reverting it produces a correct HLS.

 The audio track is mapped multiple times just to simulate multiple audio
 languages.

 `ffmpeg -i input.mp4 -i en.vtt -i nl.vtt -c copy -map 0:v:0 -map 0:v:0
 -map 0:v:0 -map 0:a:0 -map 0:a:0 -map 1:s:0 -map 2:s:0 -f hls
 -var_stream_map "a:0,name:en_audio,agroup:audio,language:en,default:YES
 a:1,name:nl_audio,agroup:audio,language:nl,default:NO
 v:0,name:en,s:0,sgroup:subtitle,language:en,default:NO
 v:1,name:nl,s:1,sgroup:subtitle,language:nl,default:NO
 v:2,name:high,agroup:audio" "%v.m3u8"`

 Output:

 {{{
 ffmpeg version 7.0.1 Copyright (c) 2000-2024 the FFmpeg developers
   built with gcc 12 (Debian 12.2.0-14)
   configuration: --prefix=/usr/local --toolchain=hardened --enable-gpl
 --enable-version3 --enable-nonfree --enable-postproc --enable-avfilter
 --enable-libfontconfig --enable-libfreetype --enable-pthreads --enable-
 libopenjpeg --enable-gmp --enable-openssl --enable-libx264 --enable-
 libx265 --enable-libzmq --enable-libsrt --enable-libnpp --enable-cuda
 --enable-cuda-nvcc --enable-cuvid --enable-nvenc --enable-
 filter=scale_cuda --enable-filter=hwupload_cuda --enable-filter=hwdownload
 --enable-filter=thumbnail_cuda --extra-cflags=-I/usr/local/cuda/include
 --extra-ldflags=-L/usr/local/cuda/lib64
   libavutil      59.  8.100 / 59.  8.100
   libavcodec     61.  3.100 / 61.  3.100
   libavformat    61.  1.100 / 61.  1.100
   libavdevice    61.  1.100 / 61.  1.100
   libavfilter    10.  1.100 / 10.  1.100
   libswscale      8.  1.100 /  8.  1.100
   libswresample   5.  1.100 /  5.  1.100
   libpostproc    58.  1.100 / 58.  1.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf58.45.100
   Duration: 00:03:47.46, start: 0.000000, bitrate: 2513 kb/s
   Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661),
 yuv420p(tv, bt709, progressive), 1458x1080 [SAR 1:1 DAR 27:20], 2380 kb/s,
 23.98 fps, 23.98 tbr, 24k tbn (default)
       Metadata:
         handler_name    : ISO Media file produced by Google Inc.
         vendor_id       : [0][0][0][0]
   Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
 stereo, fltp, 127 kb/s (default)
       Metadata:
         handler_name    : ISO Media file produced by Google Inc.
         vendor_id       : [0][0][0][0]
 Input #1, webvtt, from 'en.vtt':
   Duration: N/A, bitrate: N/A
   Stream #1:0: Subtitle: webvtt
 Input #2, webvtt, from 'nl.vtt':
   Duration: N/A, bitrate: N/A
   Stream #2:0: Subtitle: webvtt
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:0 -> #0:1 (copy)
   Stream #0:0 -> #0:2 (copy)
   Stream #0:1 -> #0:3 (copy)
   Stream #0:1 -> #0:4 (copy)
   Stream #1:0 -> #0:5 (copy)
   Stream #2:0 -> #0:6 (copy)
 [mpegts @ 0x5650f6143b80] frame size not set
 [mpegts @ 0x5650f614fac0] frame size not set
 [hls @ 0x5650f611c140] Opening 'en0.vtt' for writing
 [hls @ 0x5650f611c140] Opening 'nl0.vtt' for writing
 Output #0, hls, to '%v.m3u8':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf61.1.100
   Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
 bt709, progressive), 1458x1080 [SAR 1:1 DAR 27:20], q=2-31, 2380 kb/s,
 23.98 fps, 23.98 tbr, 90k tbn (default)
       Metadata:
         handler_name    : ISO Media file produced by Google Inc.
         vendor_id       : [0][0][0][0]
   Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
 bt709, progressive), 1458x1080 [SAR 1:1 DAR 27:20], q=2-31, 2380 kb/s,
 23.98 fps, 23.98 tbr, 90k tbn (default)
       Metadata:
         handler_name    : ISO Media file produced by Google Inc.
         vendor_id       : [0][0][0][0]
   Stream #0:2(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
 bt709, progressive), 1458x1080 [SAR 1:1 DAR 27:20], q=2-31, 2380 kb/s,
 23.98 fps, 23.98 tbr, 90k tbn (default)
       Metadata:
         handler_name    : ISO Media file produced by Google Inc.
         vendor_id       : [0][0][0][0]
   Stream #0:3(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo,
 fltp, 127 kb/s (default)
       Metadata:
         handler_name    : ISO Media file produced by Google Inc.
         vendor_id       : [0][0][0][0]
   Stream #0:4(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo,
 fltp, 127 kb/s (default)
       Metadata:
         handler_name    : ISO Media file produced by Google Inc.
         vendor_id       : [0][0][0][0]
   Stream #0:5: Subtitle: webvtt (default)
   Stream #0:6: Subtitle: webvtt
 Press [q] to stop, [?] for help
 Segmentation fault
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9719#comment:7>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list