-
Notifications
You must be signed in to change notification settings - Fork 506
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
Adding dash_only and hls_only parameters #721
Changes from 4 commits
30f4fc2
a65cb99
1fd9999
88e1a79
02548a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,21 @@ | |
|
||
The above packaging command creates five single file MP4 streams, and HLS | ||
playlists as well as DASH manifests. | ||
|
||
* Output DASH + HLS with dash_only and hls_only options | ||
|
||
$ packager \ | ||
'in=h264_baseline_360p_600.mp4,stream=audio,init_segment=audio/init.mp4,segment_template=audio/$Number$.m4s' \ | ||
'in=input_text.vtt,stream=text,init_segment=text/init.mp4,segment_template=text/$Number$.m4s',dash_only=true' \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, I accidentally included an extra ' after "m4s", can you remove it? Same below. |
||
'in=input_text.vtt,stream=text,segment_template=text/$Number$.vtt',hls_only=true' \ | ||
'in=h264_baseline_360p_600.mp4,stream=video,init_segment=h264_360p/init.mp4,segment_template=h264_360p/$Number$.m4s' \ | ||
'in=h264_main_480p_1000.mp4,stream=video,init_segment=h264_480p/init.mp4,segment_template=h264_480p/$Number$.m4s' \ | ||
'in=h264_main_720p_3000.mp4,stream=video,init_segment=h264_720p/init.mp4,segment_template=h264_720p/$Number$.m4s' \ | ||
'in=h264_high_1080p_6000.mp4,stream=video,init_segment=h264_1080p/init.mp4,segment_template=h264_1080p/$Number$.m4s' \ | ||
--generate_static_live_mpd --mpd_output h264.mpd \ | ||
--hls_master_playlist_output h264_master.m3u8 | ||
|
||
The above packaging command creates HLS playlists and DASH manifest while using | ||
dash_only for creating segmented WebVTT in mp4 format and hls_only option for | ||
creating WebVTT in text format. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#EXTM3U | ||
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test> | ||
|
||
#EXT-X-STREAM-INF:BANDWIDTH=973483,AVERAGE-BANDWIDTH=879459,CODECS="avc1.64001e",RESOLUTION=640x360,FRAME-RATE=29.970 | ||
stream_1.m3u8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--Generated with https://github.com/google/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.739954710006714S"> | ||
<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="793-860" timescale="44100"> | ||
<Initialization range="0-792"/> | ||
</SegmentBase> | ||
</Representation> | ||
</AdaptationSet> | ||
</Period> | ||
</MPD> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:6 | ||
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test> | ||
#EXT-X-TARGETDURATION:2 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-MAP:URI="bear-640x360-video.mp4",BYTERANGE="859@0" | ||
#EXTINF:1.001, | ||
#EXT-X-BYTERANGE:99313@927 | ||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,11 @@ struct StreamDescriptor { | |
std::vector<std::string> dash_accessiblities; | ||
/// Optional for DASH output. It defines Role elements of the stream. | ||
std::vector<std::string> dash_roles; | ||
|
||
/// Set to true to indicate that the stream is for dash only. | ||
bool dash_only = false; | ||
/// Set to true to indicate that the stream is for hls only. | ||
bool hls_only = false; | ||
}; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a test in packager_test.py? One option is to modify it from https://github.com/google/shaka-packager/blob/master/packager/app/test/packager_test.py#L652 and use dash_only for audio and use hls_only for video. After writing the test, you can run the below command to generate the golden files for you. $ ninja -C out/Debug
$ out/Debug/packager_test.py --test_update_golden_files=1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will add the test. Thanks for the commands. |
||
class SHAKA_EXPORT Packager { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also update https://github.com/google/shaka-packager/blob/master/docs/source/options/dash_options.rst and https://github.com/google/shaka-packager/blob/master/docs/source/options/hls_options.rst? It will be great if you can add an example to https://raw.githubusercontent.com/google/shaka-packager/master/docs/source/tutorials/dash_hls_example.rst too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes have updated the mentioned files. Please review and let me know. |
||
|
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.
Can we update this example to use a practical use case?
For example, HLS requires WebVTT in text format while DASH supports only segmented WebVTT in mp4 format. So that is an excellent use case for the two flags.