#7337 closed defect (fixed)
FFmpeg not recognizing WebVTT subtitle stream from HLS playlist
| Reported by: | newsfanatic | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | avformat |
| Version: | 7.1 | Keywords: | hls webvtt |
| Cc: | mkuron | Blocked By: | |
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
Summary of the bug:
When trying to ingest an HLS playlist from an m3u8 endpoint online to an mkv container, the subtitle stream is not being picked up at all. I can confirm that all other audio and video streams are being recognized, whilst the subtitle stream is not. I can also confirm that WebVTT is listed as a supported subtitle codec from ffmpeg -codecs. Specifying -map 0 also fails to pick up the subtitle stream. Am I just forgetting a flag or option?
How to reproduce:
% ffmpeg -report -i https://ajo.prod.reuters.tv/rest/v2/xato/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/video.m3u8 -c copy reuters.mkv ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers built with Apple LLVM version 9.0.0 (clang-900.0.39.2) configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0.2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 libpostproc 55. 1.100 / 55. 1.100
Subtitles are specified in the M3U8 manifest with the #EXT-X-MEDIA tag. M3U8 manifest:
#EXTM3U #EXT-X-VERSION:4 #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,URI="https://ajo.prod.reuters.tv/rest/v2/captions/vtt/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635" #EXT-X-STREAM-INF:BANDWIDTH=360800,CODECS="mp4a.40.2,avc1.64000D",RESOLUTION=320x180,SUBTITLES="subs" https://ajo.prod.reuters.tv/rest/v2/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/resolution/320x180/codecs/ignored #EXT-X-STREAM-INF:BANDWIDTH=499400,CODECS="mp4a.40.2,avc1.640015",RESOLUTION=512x288,SUBTITLES="subs" https://ajo.prod.reuters.tv/rest/v2/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/resolution/512x288/codecs/ignored #EXT-X-STREAM-INF:BANDWIDTH=984500,CODECS="mp4a.40.2,avc1.64001E",RESOLUTION=640x360,SUBTITLES="subs" https://ajo.prod.reuters.tv/rest/v2/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/resolution/640x360/codecs/ignored #EXT-X-STREAM-INF:BANDWIDTH=1490500,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=854x480,SUBTITLES="subs" https://ajo.prod.reuters.tv/rest/v2/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/resolution/854x480/codecs/ignored #EXT-X-STREAM-INF:BANDWIDTH=2006400,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=960x540,SUBTITLES="subs" https://ajo.prod.reuters.tv/rest/v2/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/resolution/960x540/codecs/ignored #EXT-X-STREAM-INF:BANDWIDTH=3020600,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=1024x576,SUBTITLES="subs" https://ajo.prod.reuters.tv/rest/v2/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/resolution/1024x576/codecs/ignored #EXT-X-STREAM-INF:BANDWIDTH=4021600,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=1280x720,SUBTITLES="subs" https://ajo.prod.reuters.tv/rest/v2/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/resolution/1280x720/codecs/ignored #EXT-X-STREAM-INF:BANDWIDTH=4998400,CODECS="mp4a.40.2,avc1.640028",RESOLUTION=1920x1080,SUBTITLES="subs" https://ajo.prod.reuters.tv/rest/v2/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/resolution/1920x1080/codecs/ignored #EXT-X-STREAM-INF:BANDWIDTH=113300,CODECS="mp4a.40.2",SUBTITLES="subs" https://ajo.prod.reuters.tv/rest/v2/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/codecs/ignored
WebVTT asset manifest:
#EXTM3U #EXT-X-VERSION:4 #EXT-X-TARGETDURATION:96 #EXTINF:5.5666, no desc https://ajo.prod.reuters.tv/rest/v2/captions/vtt/asset/57630 #EXT-X-DISCONTINUITY #EXTINF:4.4, no desc https://ajo.prod.reuters.tv/rest/v2/captions/vtt/asset/163881 #EXT-X-DISCONTINUITY #EXTINF:4.9667, no desc https://ajo.prod.reuters.tv/rest/v2/captions/vtt/asset/163829 #EXT-X-DISCONTINUITY #EXTINF:4.6333, no desc https://ajo.prod.reuters.tv/rest/v2/captions/vtt/asset/57447 #EXT-X-DISCONTINUITY #EXTINF:2.3, no desc https://ajo.prod.reuters.tv/rest/v2/captions/vtt/asset/127691 #EXT-X-DISCONTINUITY #EXTINF:2.3, no desc https://ajo.prod.reuters.tv/rest/v2/captions/vtt/asset/127676 #EXT-X-DISCONTINUITY #EXTINF:65.2, no desc https://ajo.prod.reuters.tv/rest/v2/captions/vtt/asset/163830 #EXT-X-DISCONTINUITY #EXTINF:2.3, no desc https://ajo.prod.reuters.tv/rest/v2/captions/vtt/asset/127649 #EXT-X-DISCONTINUITY #EXTINF:95.7, no desc https://ajo.prod.reuters.tv/rest/v2/captions/vtt/asset/163855 #EXT-X-DISCONTINUITY #EXTINF:5.0, no desc https://ajo.prod.reuters.tv/rest/v2/captions/vtt/asset/57635 #EXT-X-ENDLIST
Sample WebVTT blob:
WEBVTT X-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000 1 00:00:00.370 --> 00:00:01.700 line:-3 You're watching Reuters TV. 2 00:00:02.790 --> 00:00:04.270 line:-3 Here are your top stories.
FFmpeg input report:
Input #0, hls,applehttp, from 'https://ajo.prod.reuters.tv/rest/v2/xato/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/video.m3u8':
Duration: 00:03:12.37, start: 10.000000, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 360800
Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 360800
Stream #0:1: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 320x180 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
Metadata:
variant_bitrate : 360800
Program 1
Metadata:
variant_bitrate : 499400
Stream #0:2: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 499400
Stream #0:3: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 512x288 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
Metadata:
variant_bitrate : 499400
Program 2
Metadata:
variant_bitrate : 984500
Stream #0:4: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 984500
Stream #0:5: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
Metadata:
variant_bitrate : 984500
Program 3
Metadata:
variant_bitrate : 1490500
Stream #0:6: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 1490500
Stream #0:7: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 854x480 [SAR 1280:1281 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
Metadata:
variant_bitrate : 1490500
Program 4
Metadata:
variant_bitrate : 2006400
Stream #0:8: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 2006400
Stream #0:9: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 960x540 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
Metadata:
variant_bitrate : 2006400
Program 5
Metadata:
variant_bitrate : 3020600
Stream #0:10: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 3020600
Stream #0:11: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1024x576 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
Metadata:
variant_bitrate : 3020600
Program 6
Metadata:
variant_bitrate : 4021600
Stream #0:12: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 4021600
Stream #0:13: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
Metadata:
variant_bitrate : 4021600
Program 7
Metadata:
variant_bitrate : 4998400
Stream #0:14: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 4998400
Stream #0:15: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
Metadata:
variant_bitrate : 4998400
Program 8
Metadata:
variant_bitrate : 113300
Stream #0:16: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 113300
Attachments (1)
Change History (13)
by , 8 years ago
| Attachment: | ffmpeg-20180730-112735.tgz added |
|---|
comment:1 by , 8 years ago
you can try : ffmpeg -report -strict experimental -i https://ajo.prod.reuters.tv/rest/v2/xato/playlist/assets/57630,163881,163829,57447,127691,163890,127676,163830,127649,163855,57635/video.m3u8 -c copy reuters.mkv
Now HLS demuxer support subtitle is experimental.
comment:2 by , 8 years ago
| Component: | undetermined → avformat |
|---|---|
| Keywords: | hls webvtt added; WebVTT HLS m3u8 playlist subtitles removed |
| Priority: | normal → wish |
| Type: | defect → enhancement |
comment:3 by , 5 years ago
| Cc: | added |
|---|
comment:4 by , 4 years ago
| Resolution: | → needs_more_info |
|---|---|
| Status: | new → closed |
comment:6 by , 14 months ago
The problem still exists:
The live stream of Spanish national public broadcaster RTVE can be watched using one of the following directions (both are probably geo-blocked):
https://ztnr.rtve.es/ztnr/1688885.m3u8 https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr.m3u8
When watching them directly within VLC Player, several subtitles are available (spanish, catalan etc.).
VLC Player tells me, that the subtitles are using the webvtt format. According to https://trac.ffmpeg.org/wiki/ExtractSubtitles ffmpeg should be able to encode and decode this format. But using options like .... -scodec webvtt or -scodec mov_text or -scodec dvbsub don't show any change.
Using ffmpeg, version 7.1.1 results in the following error message: ("Can't support the subtitle")
C:\Users\malvinas2\Documents>c:\ffmpeg\bin\ffmpeg -i https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr.m3u8 -c copy -copy_unknown meintestvideo3.mkv > error.txt
ffmpeg version 7.1.1-essentials_build-www.gyan.dev Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 14.2.0 (Rev1, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
[hls @ 000001dbf602f340] Skip ('## Created with Golumi Video Platform')
[hls @ 000001dbf602f340] Can't support the subtitle(uri: https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_es.m3u8)
[hls @ 000001dbf602f340] Can't support the subtitle(uri: https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_en.m3u8)
[hls @ 000001dbf602f340] Can't support the subtitle(uri: https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_gl.m3u8)
[hls @ 000001dbf602f340] Can't support the subtitle(uri: https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_ca.m3u8)
[hls @ 000001dbf602f340] Can't support the subtitle(uri: https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_eu.m3u8)
[hls @ 000001dbf602f340] Opening 'https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_a_155.m3u8' for reading
[hls @ 000001dbf602f340] Skip ('## Created with Golumi Video Platform')
[hls @ 000001dbf602f340] Skip ('#EXT-X-VERSION:3')
[hls @ 000001dbf602f340] Skip ('#EXT-X-ALLOW-CACHE:YES')
[https @ 000001dbf6629e40] Opening 'https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_a_156.m3u8' for reading
[hls @ 000001dbf602f340] Skip ('## Created with Golumi Video Platform')
[hls @ 000001dbf602f340] Skip ('#EXT-X-VERSION:3')
[hls @ 000001dbf602f340] Skip ('#EXT-X-ALLOW-CACHE:YES')
[https @ 000001dbf6629e40] Opening 'https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_720.m3u8' for reading
[hls @ 000001dbf602f340] Skip ('## Created with Golumi Video Platform')
[hls @ 000001dbf602f340] Skip ('#EXT-X-VERSION:3')
[hls @ 000001dbf602f340] Skip ('#EXT-X-ALLOW-CACHE:YES')
[https @ 000001dbf6629e40] Opening 'https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_576.m3u8' for reading
[hls @ 000001dbf602f340] Skip ('## Created with Golumi Video Platform')
[hls @ 000001dbf602f340] Skip ('#EXT-X-VERSION:3')
[hls @ 000001dbf602f340] Skip ('#EXT-X-ALLOW-CACHE:YES')
[https @ 000001dbf6629e40] Opening 'https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_360.m3u8' for reading
[hls @ 000001dbf602f340] Skip ('## Created with Golumi Video Platform')
[hls @ 000001dbf602f340] Skip ('#EXT-X-VERSION:3')
[hls @ 000001dbf602f340] Skip ('#EXT-X-ALLOW-CACHE:YES')
[https @ 000001dbf6629e40] Opening 'https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_180.m3u8' for reading
[hls @ 000001dbf602f340] Skip ('## Created with Golumi Video Platform')
[hls @ 000001dbf602f340] Skip ('#EXT-X-VERSION:3')
[hls @ 000001dbf602f340] Skip ('#EXT-X-ALLOW-CACHE:YES')
[hls @ 000001dbf602f340] Opening 'https://rtvelivestream.rtve.es/rtvesec/la2/GL1/155_a_2_2025_05_25_23_11_51_12378.ts' for reading
Content of the m3u file is the following:
#EXTM3U ## Created with Golumi Video Platform #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audios",NAME="Castellano",LANGUAGE="spa",CHANNELS="2",DEFAULT=YES,AUTOSELECT=YES #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audios",NAME="original",LANGUAGE="qaa",CHANNELS="2",DEFAULT=NO,URI="https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_a_155.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audios",NAME="Audio Descripcion",LANGUAGE="ads",CHANNELS="2",DEFAULT=NO,AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.describes-video",URI="https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_a_156.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitulos",NAME="Español",LANGUAGE="es",DEFAULT=NO,FORCED=NO,URI="https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_es.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitulos",NAME="Inglés",LANGUAGE="en",DEFAULT=NO,FORCED=NO,URI="https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_en.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitulos",NAME="Gallego",LANGUAGE="gl",DEFAULT=NO,FORCED=NO,URI="https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_gl.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitulos",NAME="Catalán",LANGUAGE="ca",DEFAULT=NO,FORCED=NO,URI="https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_ca.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitulos",NAME="Euskera",LANGUAGE="eu",DEFAULT=NO,FORCED=NO,URI="https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_eu.m3u8" #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3012608,AVERAGE-BANDWIDTH=3012608,RESOLUTION=1280x720,CODECS="avc1.640029,mp4a.40.2",AUDIO="audios",SUBTITLES="subtitulos" https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_720.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2025472,AVERAGE-BANDWIDTH=2025472,RESOLUTION=1024x576,CODECS="avc1.640029,mp4a.40.2",AUDIO="audios",SUBTITLES="subtitulos" https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_576.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1155072,AVERAGE-BANDWIDTH=1155072,RESOLUTION=640x360,CODECS="avc1.640029,mp4a.40.2",AUDIO="audios",SUBTITLES="subtitulos" https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_360.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=643072,AVERAGE-BANDWIDTH=643072,RESOLUTION=320x180,CODECS="avc1.640029,mp4a.40.2",AUDIO="audios",SUBTITLES="subtitulos" https://rtvelivestream.rtve.es/rtvesec/la2/la2_main_dvr_180.m3u8
comment:7 by , 14 months ago
| Priority: | wish → normal |
|---|---|
| Resolution: | needs_more_info |
| Status: | closed → reopened |
| Type: | enhancement → defect |
| Version: | git-master → 7.1 |
comment:8 by , 14 months ago
Support for WebVTT subtitles in HLS has just been added. Try a nightly build.
comment:9 by , 14 months ago
Thank you softworkz, ffmpeg version 2025-05-21-git-4099d53759-essentials_build-www.gyan.dev works like a charm!
comment:10 by , 14 months ago
You were lucky, I've just seen this ticked by coincidence :-)
Please don't forget to close.
comment:11 by , 14 months ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |



ffmpeg report