Opened 6 years ago

Closed 2 years ago

Last modified 14 months ago

#7337 closed enhancement (needs_more_info)

FFmpeg not recognizing WebVTT subtitle stream from HLS playlist

Reported by: newsfanatic Owned by:
Priority: wish Component: avformat
Version: git-master 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)

ffmpeg-20180730-112735.tgz (193.8 KB ) - added by newsfanatic 6 years ago.
ffmpeg report

Download all attachments as: .zip

Change History (6)

by newsfanatic, 6 years ago

Attachment: ffmpeg-20180730-112735.tgz added

ffmpeg report

comment:1 by Jun Zhao, 6 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 Carl Eugen Hoyos, 6 years ago

Component: undeterminedavformat
Keywords: hls webvtt added; WebVTT HLS m3u8 playlist subtitles removed
Priority: normalwish
Type: defectenhancement

comment:3 by mkuron, 3 years ago

Cc: mkuron added

comment:4 by Carl Eugen Hoyos, 2 years ago

Resolution: needs_more_info
Status: newclosed

comment:5 by piusbnsl, 14 months ago

Is this issue resolved?

Note: See TracTickets for help on using tickets.