Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible for HTML5 video to play subtitles embedded in mp4 file as a track?

I imported Webvtt file into mp4 file as a track, following the instruction Subtitling with GPAC

,and I checked that subtitles are properly shown when I using GPAC's Osmo4 player.

Now, I'd like to play this video with subtitle through HTML5 video tag, but it seems that HTML media track element is requiring src attribute that designate location of the webvtt file.

Is there any way to play embedded subtitle?

like image 629
han0ah Avatar asked Dec 01 '14 07:12

han0ah


People also ask

Does MP4 support embedded subtitles?

With MP4, you can burn ONLY 1 subtitle track into the video. You can not pass-through PGS into MP4 as this file format does not support it. With MKV, you can pass-through multiple PGS tracks. These are not burned into the video unless you choose to do so however you can only burn 1 subtitle track into the file.

Does HTML5 support SRT?

SRT to VTT on the fly Since HTML5 we can add captions to video's, however only VTT formatted captions are supported. The majority of subtitles are in SRT format, but can't be used as captions in HTML video's.

Why video is not playing in HTML?

If you encountered “HTML5 video not found” error while playing a video on any website then it implies your browser doesn't support the HTML5 format codecs or your browser doesn't have the proper video codec installed.


1 Answers

No, HTML5 Video Tag does not currently support internal subtitle and audio tracks.

The correct way of inserting subtitles in HTML5 Video Tag is:

<video width="640" height="480" controls>
  <source src="video.mp4" type="video/mp4" />
  <source src="video.webm" type="video/webm" />
  <track src="subtitles.vtt" kind="subtitles" srclang="en" label="English" />
</video>

Additional Information on HTML5 Video Subtitling and WebVTT

like image 134
Jaruba Avatar answered Oct 13 '22 07:10

Jaruba