ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
24.75k stars 5.28k forks source link

The webvtt subtitles referenced by m3u8 cannot be displayed correctly on the client. #3853

Closed Wilbert0824 closed 3 months ago

Wilbert0824 commented 8 months ago

Describe the bug When playing m3u8 with streaming and subtitles, the streaming will play normally, but the subtitles cannot be displayed correctly. After logging, it was found that the client would continuously send subtitle requests to srs.

Version 5.0release (v5.0.193)

To Reproduce

  1. Compile and launch from source code using clion.
  2. Use OBS Studio to push the stream using RTMP (rtmp://localhost/live/livestream).
  3. Set up m3u8 and put the webvtt file in /trunk/objs/nginx/html/live.
  4. Use hls.js demo (https://tinyurl.com/yz72un3r), chrome extension (https://tinyurl.com/yxc5523r) or my video.js player to play index.m3u8.
  5. After successful streaming, select the option to display subtitles.
  6. See error.

Expected behavior Play streaming and subtitles simultaneously.

Additional context index.m3u8 (Generate by myself):

EXTM3U

EXT-X-VERSION:3

EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",LANGUAGE="en",URI="sublist.m3u8"

EXT-X-STREAM-INF:NAME="Main",SUBTITLES="subs"

livestream.m3u8

sublist.m3u8 (Generate by myself):

EXTM3U

EXT-X-VERSION:3

EXT-X-MEDIA-SEQUENCE:0

EXT-X-TARGETDURATION:105

EXTINF:70.817,

sub.webvtt

livestream.m3u8 (Generate by srs):

EXTM3U

EXT-X-VERSION:3

EXT-X-MEDIA-SEQUENCE:23

EXT-X-TARGETDURATION:71

EXTINF:70.833, no desc

livestream-0.ts livestream-1.ts

Wilbert0824 commented 8 months ago

Supplement: Automatically add query after .webvtt

2023-10-28_163246

winlinvip commented 3 months ago

SRS does not support HLS with WebVTT subtitle, which is also not included in the RTMP specfication. And the source for generating subtitle is uncertain, meaning you can not add existing WebVTT file to a live stream, because in real world the live stream can not be described by fixed subtitle.

Now, with the ability and development in AI, it is now possible to generate subtitle automatically during live stream. This feature is supported by Oryx, not by SRS. Please refer to the transcript feature of Oryx, see Revolutionizing Live Streams with AI Transcription: Creating Accessible, Multilingual Subtitles for Diverse Audiences