forked from shaka-project/shaka-packager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: HLS / DASH support forced subtitle (shaka-project#1020)
Closes shaka-project#988 --------- Co-authored-by: Cosmin Stejerean <cstejerean@meta.com>
- Loading branch information
Showing
28 changed files
with
236 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packager/app/test/testdata/forced-subtitle/bear-640x360-audio.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:6 | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
#EXT-X-TARGETDURATION:5 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-MAP:URI="bear-640x360-audio.mp4",BYTERANGE="804@0" | ||
#EXTINF:1.022, | ||
#EXT-X-BYTERANGE:17028@872 | ||
bear-640x360-audio.mp4 | ||
#EXTINF:0.998, | ||
#EXT-X-BYTERANGE:16285 | ||
bear-640x360-audio.mp4 | ||
#EXTINF:0.720, | ||
#EXT-X-BYTERANGE:9558 | ||
bear-640x360-audio.mp4 | ||
#EXT-X-ENDLIST |
Binary file not shown.
17 changes: 17 additions & 0 deletions
17
packager/app/test/testdata/forced-subtitle/bear-640x360-video-iframe.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:6 | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
#EXT-X-TARGETDURATION:5 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-I-FRAMES-ONLY | ||
#EXT-X-MAP:URI="bear-640x360-video.mp4",BYTERANGE="870@0" | ||
#EXTINF:1.001, | ||
#EXT-X-BYTERANGE:15581@938 | ||
bear-640x360-video.mp4 | ||
#EXTINF:1.001, | ||
#EXT-X-BYTERANGE:18221@100251 | ||
bear-640x360-video.mp4 | ||
#EXTINF:0.734, | ||
#EXT-X-BYTERANGE:19663@222058 | ||
bear-640x360-video.mp4 | ||
#EXT-X-ENDLIST |
16 changes: 16 additions & 0 deletions
16
packager/app/test/testdata/forced-subtitle/bear-640x360-video.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:6 | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
#EXT-X-TARGETDURATION:5 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-MAP:URI="bear-640x360-video.mp4",BYTERANGE="870@0" | ||
#EXTINF:1.001, | ||
#EXT-X-BYTERANGE:99313@938 | ||
bear-640x360-video.mp4 | ||
#EXTINF:1.001, | ||
#EXT-X-BYTERANGE:121807 | ||
bear-640x360-video.mp4 | ||
#EXTINF:0.734, | ||
#EXT-X-BYTERANGE:79662 | ||
bear-640x360-video.mp4 | ||
#EXT-X-ENDLIST |
Binary file not shown.
11 changes: 11 additions & 0 deletions
11
packager/app/test/testdata/forced-subtitle/bear-english-text.vtt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
WEBVTT | ||
STYLE | ||
::cue { color:lime } | ||
00:00:00.000 --> 00:00:00.800 align:center | ||
Yup, that's a bear, eh. | ||
|
||
00:00:01.000 --> 00:00:04.700 align:center | ||
He 's... um... doing bear-like stuff. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#EXTM3U | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
|
||
#EXT-X-INDEPENDENT-SEGMENTS | ||
|
||
#EXT-X-MEDIA:TYPE=AUDIO,URI="bear-640x360-audio.m3u8",GROUP-ID="default-audio-group",NAME="stream_0",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="2" | ||
|
||
#EXT-X-MEDIA:TYPE=SUBTITLES,URI="stream_2.m3u8",GROUP-ID="default-text-group",NAME="stream_2",DEFAULT=NO,AUTOSELECT=YES,FORCED=YES | ||
|
||
#EXT-X-STREAM-INF:BANDWIDTH=1106817,AVERAGE-BANDWIDTH=1004632,CODECS="avc1.64001e,mp4a.40.2",RESOLUTION=640x360,FRAME-RATE=29.970,AUDIO="default-audio-group",SUBTITLES="default-text-group",CLOSED-CAPTIONS=NONE | ||
bear-640x360-video.m3u8 | ||
|
||
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=214292,AVERAGE-BANDWIDTH=156327,CODECS="avc1.64001e",RESOLUTION=640x360,CLOSED-CAPTIONS=NONE,URI="bear-640x360-video-iframe.m3u8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>--> | ||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT2.736067S"> | ||
<Period id="0"> | ||
<AdaptationSet id="0" contentType="audio" subsegmentAlignment="true"> | ||
<Representation id="0" bandwidth="133334" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="44100"> | ||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/> | ||
<BaseURL>bear-640x360-audio.mp4</BaseURL> | ||
<SegmentBase indexRange="804-871" timescale="44100"> | ||
<Initialization range="0-803"/> | ||
</SegmentBase> | ||
</Representation> | ||
</AdaptationSet> | ||
<AdaptationSet id="1" contentType="video" width="640" height="360" frameRate="30000/1001" subsegmentAlignment="true" par="16:9"> | ||
<Representation id="1" bandwidth="973483" codecs="avc1.64001e" mimeType="video/mp4" sar="1:1"> | ||
<BaseURL>bear-640x360-video.mp4</BaseURL> | ||
<SegmentBase indexRange="870-937" timescale="30000"> | ||
<Initialization range="0-869"/> | ||
</SegmentBase> | ||
</Representation> | ||
</AdaptationSet> | ||
<AdaptationSet id="2" contentType="text" subsegmentAlignment="true"> | ||
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="forced-subtitle"/> | ||
<Representation id="2" bandwidth="317" mimeType="text/vtt"> | ||
<BaseURL>bear-english-text.vtt</BaseURL> | ||
</Representation> | ||
</AdaptationSet> | ||
</Period> | ||
</MPD> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:6 | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
#EXT-X-TARGETDURATION:5 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXTINF:4.700, | ||
bear-english-text.vtt | ||
#EXT-X-ENDLIST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.