-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: HLS / DASH support forced subtitle #1020
Merged
Merged
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ec7ee0a
dash - support ROLE=forced-subtitle
vish91 0d453f7
HLS - add forced flag for SUBTITLES
vish91 3d6fb6f
HLS forced flag to master playlist
vish91 c1b13af
wip: set forced proto
vish91 48668b2
add to hls muxer
vish91 92d0bf9
set forced for hls muxer
vish91 b352cdd
clang-format
vish91 e7ff17a
fix linting: clang-format
vish91 2427acf
Merge branch 'main' of https://github.com/shaka-project/shaka-package…
vish91 b8ee6b1
fix: hls notify muxer set forced field
vish91 8298398
set HLS forced flag in order
vish91 c424df8
fix: const qualifier not required
vish91 288eddc
Merge branch 'main' of https://github.com/shaka-project/shaka-package…
vish91 1adccb6
Merge branch 'main' of https://github.com/shaka-project/shaka-package…
vish91 49e6e27
fix: cmake changes from base to std
vish91 490fafe
Merge branch 'main' of https://github.com/shaka-project/shaka-package…
vish91 373a6ed
Merge branch 'main' of https://github.com/shaka-project/shaka-package…
vish91 4ebfe84
linter issues
vish91 94842f2
adjust the case fallthrough missing break
vish91 f8df4b9
typo muxer listener factory creation
vish91 660958a
use forced_subtitle stream descriptor as the generic way to do this f…
cosmin 08fe6ef
run format
cosmin 77449ef
format packager_test.py as well
cosmin 8483383
fix typos
cosmin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣