Commit Graph

275 Commits

Author SHA1 Message Date
KongQun Yang 0ef078a23b Fix default_language not effective with 2-char code
Two-character ISO-639 code in --default_language was ignored due to
a bug in language code matching as the language code in stream is
always converted to 3-character code.

Fixes #371.

Change-Id: I8618938af583a417446636ff9efe1c72ce822c33
2018-04-13 20:08:12 +00:00
KongQun Yang 4549b1d569 Remove pto_adjustment flag
This flag was introduced to workaround a rounding error in Chrome
(probably in other browsers too).

Also although this flag avoids the first frame of a Period to be
dropped due to rounding error but it could cause the last frame of a
Period to be dropped.

Now that we use a high precision Period@duration, we do not expect to
see rounding errors any more. The player would be a better place for
the workaround even if it is still needed.

Related issue: #368.

Change-Id: I3bd517ecc6d548ff62e0c13394edb49d4bc68e8f
2018-04-13 20:07:47 +00:00
KongQun Yang 09dc0a1907 Collect and generate license notice
Under flag --licenses

Bug: 74447460

Change-Id: If99c4e927431ce08158e3734428e3b4d23d62c75
2018-04-13 00:29:55 +00:00
KongQun Yang 772aa7c93f Do not force earliest_presentation_time to 0 for VOD
Instead, the actual earliest presentation time is used except for
the first segment if there is an offset between presentation time
(pts) and decoding time (dts).

Chrome (as of v66) reports dts instead of pts in buffered ranges in
MSE API. To avoid breaking Chrome, the earliest_presentation_time
of the first segment is set to its dts as Chrome does not like negative
values for
  adjusted dts = dts + Period@start (0 for the first period)
                 - presentationTimeOffset (earliest_presentation_time).

Fixes #303.

Change-Id: I5ca80e05d5570961400499436f2bcc01f06e69e0
2018-04-09 18:39:15 +00:00
KongQun Yang 222737d5b5 Support UTCTiming
UTCTiming schemeIdUri and value pairs can be provided to packager using
--utc_timings flag. It should be comma separated list of
schemeIdUri=value pairs.

Note that urn:mpeg:dash:utc:direct:2014 scheme is not supported as it
requires the MPD to be dynamically generated on the fly when MPD is
served to client.

Fixes #311.

Change-Id: Ibc07af8a6d8b2b6261ba3ecd2c02f23809f96614
2018-04-04 01:37:01 +00:00
KongQun Yang 634ee65663 Generate a more accurate time in Period@duration
Chrome internally uses time accurate to microseconds, which is
implemented per MSE spec (https://www.w3.org/TR/media-source/).

Generate Period@duration with better precision to avoid possible
buffered range gaps in Chrome (possibly other browsers too), which
may lead to other problems like playback stall.

b/74238961
Fixes #368.

Change-Id: I357a0f62b67f75c7ca044bb99ea4e3c8bbb6fecd
2018-04-03 21:42:33 +00:00
Aaron Vaage 113a7d123b Don't Output Empty Text Samples
Only output text samples to webvtt text output when they have a payload.

Change-Id: I958d2b4f087209f540fa32cef002cd2cef37c65c
2018-04-03 18:29:41 +00:00
Aaron Vaage e5fe2a76d2 Created Text Padder Handler To Fill Gaps
Created a media handler to come after parsers that will handle filling
in gaps between text samples. The padder takes a min duration, and if
the samples do not cover the min duration when flushed, one last empty
sample will be injected so that the samples will go up to the min duration.

Change-Id: I88605059664d09279676edac418ff3d4990d7556
2018-04-02 23:11:26 +00:00
KongQun Yang 14aab56474 Allow SyncPointQueue to be cancelled
Change-Id: Idbf6ee7a5d9721681811189fca4190e7a0286c83
2018-03-27 19:14:37 +00:00
Haoming Chen fac16cbf0a Implement multi DRM support. (Part 2)
- Allow including  Widevine and Playready PSSH boxes for RawKeySource.

Partially addresses issue #245

Change-Id: I8a48d6dbbbc21c76cf2c44384dd70286ccf80363
2018-03-26 20:18:22 +00:00
KongQun Yang 4e57259d2a Integrate CueAlignmentHandler
Also changed ChunkingHandler to be one-one handler.

Issue: #355

Change-Id: Ie98a96bcc0ddded347699c9f333f604826976d11
2018-03-26 17:58:30 +00:00
KongQun Yang 6ffa344553 Moves AdaptationSet@id management out of Period class
It is now managed in SimpleMpdNotifier.

This avoids unnecessary increment in AdaptationSet id counter.

Also makes sure the AdaptationSet is sorted by id in XML output.

Change-Id: Ibcd0b047a71c19cd30ad7d8af9a2ed0bb05e043e
2018-03-22 12:15:43 -07:00
Aaron Vaage 631bbdc883 Update Encrypted Tests to Use DiffDir
This changes almost all encrypted tests to use DiffDir. The remaining
un-updated tests are tests that won't match every time.

Change-Id: I858bbaa0beea34887cc3100eb784aa2aecd5a0a5
2018-03-13 16:37:10 +00:00
Aaron Vaage fb2dfe129c Update CheckTestResults to sanitize media info
Change MediaInfo media paths in test output to only use the filename so
that they can be compared between test runs.

Change-Id: I26bb3f5ce79a83400b8a162c61cf5b54e41f9c70
2018-03-13 16:37:10 +00:00
Aaron Vaage 5fee0391fb Change all HLS tests to generate iframe playlists
iframe playlists will be given a name based on the output name of
the main stream. This is done to ensure unique filenames between
different video output streams.

Change-Id: Id0de9c5834599e9d896243e30569c55f34e7cd68
2018-03-07 17:29:47 -08:00
Aaron Vaage b2ce6322b6 Remove Test File Index in packager_test.py
Instead of using the test file's index in a list to create the output
name, use the original filename and the descriptor.

This caused some problems with file name collisions when some tests
were using the same name. That was fixed by changing the names. This
will go away once they are transitioned to use DiffDir like the other
tests.

Change-Id: I0a4c480406705ca63fcea61c86c67d4a5f739295
2018-03-06 21:38:04 +00:00
KongQun Yang b24a95b1aa Rewrite init segment in MultiSegmentSegmenter::DoFinalize
This is called when reaching end of the file of the media. The duration
of the media is updated.

Fixes #340.

Change-Id: I446f2d341b02125d4a7d8c958bda269b5403cb9c
2018-03-05 14:25:08 -08:00
Haoming Chen 76d68de6c1 Implement multi DRM support. (Part 1)
- Refactoring current clearkey DRM support for Widevine key source.
- Add playready pssh box in Widevine key source encrypted content.

Partially addresses issue #245

Change-Id: Id30ef02ff9f8dc0e2c58d62479e07896452919cc
2018-03-03 01:39:16 +00:00
Aaron Vaage 7dd88ca5b2 Create CheckLiveTestResults
Created a method to compare test output for live tests. This wraps
CheckTestResults but first replaces the times that would diff between
manifests.

Change-Id: Iafb51a28a9bcb9f32b210c6d76bf23e2b9a3e0d6
2018-03-02 21:00:03 +00:00
Aaron Vaage 74c53239dd Updated Nested Directories Test
This require a change to the update gold method as it would not
create nested directories. Instead it deletes the old directory
and copies the whole new directory over. This made the code simplier
and far-less error prone.

Change-Id: I1da5d9bda171b0f106d1425b204139dfbcb39b42
2018-03-02 12:21:39 -08:00
Aaron Vaage 4ace2754fd Avoid Full Path until Needed in packager_test.py
To make working with file names easier in packager_test.py _GetStream
the full path is not created until needed so that multiple paths can
use the same root filename.

Change-Id: I23a9231433b22ab5cef9b88bd6359f351da56eda
2018-03-02 10:27:35 -08:00
Aaron Vaage cd16e95d79 Make All Output Filenames Similar
Changed all output file names (not paths) to follow the pattern that
any qualifier (e.g. trick play) will be join the current name using '-'
but will use '_' within itself (e.g. trick_play_1).

Change-Id: Ib0247bf1ca6d94815fedaaf73d3a400d31c20c40
2018-03-02 10:27:34 -08:00
KongQun Yang ee9b7f6392 Calculate presentationTimeOffset and Period@duration from segments
Prefer timestamps from Video AdaptationSets if available - this avoids
possible video playback jitters due to gaps.

presentationTimeOffset is not applied to the first period as it may in
negative dts which Chrome does not like: https://crbug.com/398141.

It is safe to apply to subsequent periods as the actual offset applied
takes Period@start into consideration:

    offset = Period@start - presentationTimeOffset

The result timestamp with offset applied is close to Period@start, so
it is unlikely to result in a negative dts value.

Closes b/73899306.

Change-Id: If8361f5469610093b3aac6675754536ad7e83c4c
2018-03-01 08:55:10 -08:00
Aaron Vaage 30b5fdf19f Add Text Codec To Codec String
This change has the hls master playlist add the text codec string
to the list of codecs in a variant.

Bug: 72942756

Change-Id: Ib25bb2064a291d10d7b1d261a4307991df62220c
2018-02-28 19:23:36 +00:00
Aaron Vaage c7929b1505 Remove "with" from test names
Remove the leading "with" from test directories.

Bug: 73830478
Change-Id: I45a0914b5a0e56ec9d3340ec81eb5048c1d653a3
2018-02-27 17:43:16 -08:00
Aaron Vaage bbdcf5ee91 Fix Wrong Remove Function in Packager Test
Change-Id: I58350c2041abfd3b9c533003d408d447b9213123
2018-02-27 22:30:30 +00:00
Aaron Vaage a097aa4d3b Update Many Tests to Use CheckTestResults
Updated as many tests as we easily could. The tests that were not updated
all use live manifests or encryption that all require some "help", either
by dealing with times differing or with verifying decryption.

Bug: 73830478
Change-Id: I6803c2d960b71b459eb57b7a5e562164bb713e2a
2018-02-27 13:32:32 -08:00
Aaron Vaage 60160fe602 Change Old Test Names to Current Standard
Change-Id: Ib74b1726f6515ec562fdb82a2af390e43c36b94f
2018-02-27 13:32:32 -08:00
Aaron Vaage 6e0088c4c0 Change "AudioVideo" test to use DiffDir
Changed the end-to-end test "AudioVideo" to use diff dir
instead of manually checking each file.

Change-Id: Ic1ce1e3664cde7b2b2db262a9fde0cbe2f5b400a
2018-02-27 17:12:50 +00:00
KongQun Yang b81b832522 Create GetStream
Created GetStream, a function used to get the stream descriptor for a
single stream. This allows for finer control over the stream compared
to the batch GetStreams.

Added "trick_play_factor" to GetStream so that the trick play factor
did not have to be added the stream descriptor value and "injected"
into the stream.

Change-Id: Ifbde64b961a673aafa5f6d21f33a68d02fb46610
2018-02-27 17:12:36 +00:00
Aaron Vaage 9547000eb6 Fix Update Golden With DiffDir
Change-Id: I30c79a2acaae2d3066982d84776aaa922e183515
2018-02-27 17:12:28 +00:00
Aaron Vaage a82ac20dbb Updated "testFirstStream" to use DiffDir
Change-Id: I8c279ba0c208f1e56d53460ae134b3ed8c5f552c
2018-02-23 10:10:34 -08:00
Aaron Vaage 7096ca8998 HLS WebVtt End-to-End Tests
Created end-to-end tests for the segmented webvtt text in HLS. The
text stream is longer than both audio and video, so there are more
text segments than video/audio.

Change-Id: Ib860ccd3f2ac0048983fdeebe3847a0b9dcbc160
2018-02-23 16:55:50 +00:00
Aaron Vaage 393f989839 Create DiffDir in packager_test.py
Created a method to diff the output dir against the golden copy
of the output dir. The goal with this is to simplify our end-to-end
test structure by removing the need to track the output files within
the test runner.

With all the golden output in one directory, this makes it easier to
setup end-to-end tests and even allows the golden files to be playable.

This should not affect the repo size too much as duplicate files will
only be stored in the git object store once.

Tests will migrate to this in separate CLs.

Change-Id: Id1be9f8f60c9e362b9b615445dd8ca7da996af4c
2018-02-20 11:09:06 -08:00
KongQun Yang 74f6cefb82 Change "live" setting to be "segmented"
Changed the "live" setting in _GetStreams to be "segmented" so that it
make sense in a more general sense.

Change-Id: I2ceaad67653e1e2237533b68fccbc9fe3fabfc9b
2018-02-17 00:24:24 +00:00
KongQun Yang 11cbbd86fb Fix fMP4 'cbcs' playback issue in Safari
Looks like Safari does not like v0 tenc box.

- Use v1 tenc box for cbcs and cens protection_scheme as required by
  CENCv3 spec.
- Set crypt_byte_block and skip_byte_block to 0 for full sample
  encryption cbcs and cens.

Fixes #326

Change-Id: I5581cd856fffc4ff104d950f3ca19b9337d57a78
2018-02-08 23:40:46 -08:00
KongQun Yang 7dcab4c799 Fix '--temp_dir' option does not work problem
Fixes #322

Change-Id: Ia0ea32029c81fd8ac5661f8002154e2a54d3a84d
2018-02-07 13:46:13 -08:00
Aaron Vaage a82edb5228 Make StreamDescriptor Object
Create a StreamDescriptor class that can be used to build the stream
descriptor command line argument.

Change-Id: Ifcba4f37d69a1a36c4add51a2a10c3f0c8b2ccd7
2018-02-07 19:22:05 +00:00
KongQun Yang 221ac81772 Prefer Period@duration for static MPD with >1 periods
It is easier to insert Ad Periods with Period@duration compared to
Period@start.

Change-Id: Ib52e81612562bf60b0e0513a09d9a31c42b09604
2018-02-07 01:13:28 +00:00
Aaron Vaage 48cb55c8d4 Correct WEBVTT Header In Sample Test Files
The old vtt sample data has the header as "WEBVTT FILE" which does
not reflect what the spec says it should be.

This changes it to "WEBVTT" as described in the WebVTT spec.

Change-Id: Ib54396a8b937501a835dafe966bf05b95b0b22c4
2018-02-07 00:07:16 +00:00
KongQun Yang 2d5e2b0903 Fix DCHECK of SimpleThread on invalid command line options
- Construct SimpleThreads only after all workers have been successfully
  initialized

b/72999680

Change-Id: I4016321a4bdd27b1de746c50c5f1d7a60d7ae9f1
2018-02-06 22:41:38 +00:00
KongQun Yang 8257eea804 Bug fixes and clean-ups for I-Frame playlists
- Add empty lines between different types of renditions to improve
  readability.
- Group variants with the same audio/text group together, as it is
  where the Adaptation occurs.
- Write master playlist after writing media playlists. This makes
  more sense and it is also necessary to have the bandwidth of
  the last iframe playist segment correctly computed.
- For fMP4, I-Frame segment must include the 'moof' header.
- Fix a problem that hls_iframe_playlist_name is not passed to
  MuxerListenerFactory.

Issue: #287

Change-Id: Icf37c5de1dc29f85ae3f419cbc3264d04ca491a4
2018-02-05 17:36:28 -08:00
KongQun Yang 570a2d1a15 Support 'iframe_playlist_name' stream descriptor
Issue: #287

Change-Id: I484761dfacadce05175d16c4c12454f0ed932579
2018-02-02 22:00:18 +00:00
Aaron Vaage 44847a0737 Changed Group Name Fallback
If no hls group name is given, we would default to "audio" but as
we are working to support text, this won't make sense to see
GROUP="audio" on a text stream.

Instead default to "default-audio-group" for audio streams. A specific
text default will be added later.

Bug: #205

Change-Id: Iefc8bfd35708286619d0004348294d98f2c38482
2018-02-01 10:24:58 -08:00
KongQun Yang 4194f0746e [DASH][WebM] Fix subsegmentAlignment not set problem
MuxerListener::OnNewSegment was not sent for WebM SingleSegmentSegmenter.

Change-Id: Iecae84e7a7c1a8a4d3f577158fa286b9c9959934
2018-01-31 19:58:15 +00:00
KongQun Yang 84f1f96f05 Rename SAMPLE-AES-CENC to SAMPLE-AES-CTR
Per the definition in the latest specification:
https://storage.googleapis.com/wvdocs/Widevine_DRM_HLS.pdf

Change-Id: Ic9b222c72ca8fbc4ae011e6557f2c4daaad2e624
2018-01-29 15:45:16 -08:00
KongQun Yang 9ecee46658 Fix SAMPLE-AES EC3 encryption
The IV was incorrectly updated across samples.

Created a new cryptor SampleAesEc3Cryptor specially for SAMPLE-AES
EC3 encryption / decryption. The new cryptor uses constant-iv, and
makes sure the IV is reset to the initial value at the beginning
of each audio frame and chained across syncframes within the the
audio frame.

Also added E-AC3 end to end test.

Fixes #279

Change-Id: I0aa60c17836daeef5ba433a05e5ff0906191d9ac
2018-01-24 03:02:49 +00:00
KongQun Yang 1455f43c02 Share chunkers from the same input except for WVM
Updated test files and added end to end tests for AdCues.

Change-Id: I28f57c2f0d15f65fa04f599fae446a5c1373bf47
2018-01-22 17:43:25 -08:00
KongQun Yang d9871330e7 Move common manifest flags out of mpd_flags.cc
Also updated documentations.

Fixes #304

Change-Id: I5e8e87b005ebfa9dc78d47e2501585b083120f6c
2018-01-19 21:02:54 +00:00
KongQun Yang 3c30ec3a11 Fix test failures in previous CL
Change-Id: I54dea7fe62f30a9a9648559922c02d5bad0236e3
2018-01-18 18:26:10 -08:00
KongQun Yang 32d26094ba [HLS] Support AUTOSELECT and DEFAULT in EXT-X-MEDIA
According to HLS spec: https://goo.gl/MiqjNd 4.3.4.1.1. Rendition Groups
- A Group MUST NOT have more than one member with a DEFAULT attribute of
  YES.
- Each EXT-X-MEDIA tag with an AUTOSELECT=YES attribute SHOULD have a
  combination of LANGUAGE[RFC5646], ASSOC-LANGUAGE, FORCED, and
  CHARACTERISTICS attributes that is distinct from those of other
  AUTOSELECT=YES members of its Group.

We tag the first rendition with a particular language in an audio group
with 'AUTOSELECT'; it is tagged with 'DEFAULT' too if the language
matches --default_language.

Fixes #315

Change-Id: Iacc0bc8c89ebffce8717fa65e82d6daf5a1f6adc
2018-01-19 02:10:07 +00:00
KongQun Yang 53892c7467 Add end to end test for ac3
Also updated bear-640x360.ts test files.

Change-Id: Iff53800b7b4706fb2f6d94682b9446406a94cd6f
2018-01-18 17:23:20 -08:00
Aaron Vaage 49933737cd Moved MuxerFactory to own file
To remove the direct dependencies between packager.cc and the different
muxer implementations, this change remove the muxer factory to its
own file.

Change-Id: I4a1503c493f0f4d10a67e78461f96da3f4238944
2018-01-10 17:51:26 +00:00
KongQun Yang fcc334d652 [Doc] Fix a few problems
- Add --time_shift_buffer_depth to HLS doc.
- Fix a problem in HLS tutorial

Partially address #304, fixes #305

Change-Id: I60bc1eb659a30beb0a6ab73433f4cc99a7deab07
2017-12-21 23:07:59 +00:00
Michael Stillwell a8f46fcd2e Update playlist_name docs (#307)
Make it clear that shaka packager will create the playlist file.

#305
2017-12-20 10:25:58 -08:00
Aaron Vaage dedbd8b724 Isolate Job Management
Moved all code dealing with jobs into its own class so that the
packager code does not need to worry about initializing, running,
or stopping jobs.

Change-Id: I3e9ef1f22bd93d671f77d59ad15f23d1239078cf
2017-12-13 18:35:51 +00:00
KongQun Yang 2d025dae2d Include shared_library and mpd_generator in ci and releases
Change-Id: Ie9449cbca711324831cb15e83d0efaf7a43cf9ef
2017-12-12 23:11:01 +00:00
KongQun Yang b3194866a6 [HLS] Add CHANNELS attribute to #EXT-X-MEDIA
As specified in HLS spec (https://tools.ietf.org/html/rfc8216):

All audio EXT-X-MEDIA tags SHOULD have a CHANNELS attribute.  If a
Master Playlist contains two Renditions encoded with the same
codec but a different number of channels, then the CHANNELS
attribute is REQUIRED; otherwise, it is OPTIONAL.

Fixes #299

Change-Id: Ic2308c39b170178b11cb0d94c3a8083c8b5f3353
2017-12-12 01:04:21 +00:00
Kamesh Devarakonda dac0328b47 Parse ad_cues flag.
Change-Id: I4f5897dcde20e73a01468b80a04d3f3142bc5e42
2017-11-20 16:39:16 -05:00
Kamesh Devarakonda 8c877379b6 Defined Scte35Event struct and out of band cue marker flags
Change-Id: I5a4db1a691544cbedf2ccfbaf6f71169a8eed6e7
2017-11-16 00:13:29 +00:00
KongQun Yang 5cf2b17ade Add --hls_key_uri to allow setting fairplay/identity key uri
Change-Id: I52e0f56cd10390faf515170f407ea488a6b3c9fc
2017-11-14 15:49:27 +00:00
KongQun Yang d66d307fc2 Rename fixed_key to raw_key
Change-Id: I1ee9398387b54aa685a5bef5b8704849e62ebae3
2017-10-24 21:52:01 +00:00
KongQun Yang 7c38963c29 [doc] Update raw key tutorial
Change-Id: Ife841975c036cf8042c9775583c409e0daa089c7
2017-10-24 21:51:39 +00:00
KongQun Yang 1bf1ec2445 Add multi-key support in fixed/raw keys
The keys can be specified in --keys option, with the form of
  label=<label>:key_id=<32-digit hex string>:key=<32-digit hex string>,label=...

There can be multiple "label=..." block. The DRM label can be one
of "AUDIO, SD, HD, UHD1, UHD2" or a custom label.

Mark --key and --key_id as deprecated. We can achieve the same result
with --keys=label=:key_id=<key_id>:key=<key>.

Also add a new optional field in stream descriptor: drm_label, which
is used to overwrite the internally generated DRM label for the stream.
If not provided, the DRM label is generated automatically based on
audio/video information, e.g. resolution.

Code changes:
- Merged RawKeyEncryptionParams and RawKeyDecryptionParams into
  RawKeyParams.
- Make FixedKeySource accepts RawKeyParams as input.

Change-Id: Ic8c2f071cc71188e13f14bc6396fc2b3ffa5cac6
2017-10-24 21:04:49 +00:00
KongQun Yang c9cc68ba82 [Playready] Allow unencrypted client cert private key
Change-Id: I3244b428f8e3e32787520d9dd0f015e6d9301fe0
2017-10-18 21:37:36 +00:00
Joey Parrish e2bb22c633 Update docs for HLS descriptor fields
These fields are no longer required, and have sensible defaults.

Change-Id: I35bd489c8e6058f3272210cb6f3b0f504819e7c0
2017-10-17 11:37:44 -07:00
KongQun Yang e889578a2d Creates directories in the output path if not exist
Also added end to end tests for single segment HLS and multi-segment
HLS.

Fixes #276

Change-Id: I27e5d57cdc3ab79a8e5ae0c3a8da46fcf2c467b6
2017-10-11 20:19:51 +00:00
KongQun Yang 0861452932 [Test] Rotate key_ids in PSSH as well for key rotation
Note that fixed key / raw key rotation should not be used in production.

Change-Id: I87fca41ebd00f3cadbf157ff129b8e6a9ca04e7c
2017-10-09 16:44:14 -07:00
KongQun Yang 937ecfbdcd Move language tag convertion to packager.cc
This fixes shared_library not able to compile problem.

Also removed StreamDescriptorList and replaced with expicit
comparison to make the code clearer.

Also removed an out-dated DCHECK that mpd_notifier and hls_notifier
does not co-exist.

Change-Id: I3d04b8880741fecf0931a764cc12e50aa5e392b9
2017-09-29 18:05:03 -07:00
Aaron Vaage 8067fd4818 Made Trick Play A 1:1 Handler
Before the trick play handler would have one input and multiple
outputs. The normal media handler API for adding handlers had to
be ignored when setting-up the trick play handler.

This changes the trick play handler to have one input and one output.
It uses the standard AddHandler method calls. When initialized, the
trick play factor must be provided.

This included a run of 'clang-format' over all edited files.

Change-Id: I7b3cdf0a2472e2f89ab194867c4b984e26f18f24
2017-09-26 08:25:04 -07:00
KongQun Yang 21b0ca6ea5 Cleanup README
Moved build instructions and docker instructions to separate docs.

Removed command samples which are no longer needed as we have better
tutorials now.

Change-Id: I340c5653a6553158325970dd86d76fa11e69bcbd
2017-09-19 18:44:39 -07:00
KongQun Yang b5e6cf36ab Remove the all zero KID in manifest for key rotation
Closes b/64035941

Change-Id: I382b6478889dd73bc422decf0cbf4d32cd9bb68d
2017-08-29 20:44:32 +00:00
KongQun Yang 675f2631b8 Move HlsParams to hls_params.h
Change-Id: I25189623512834da8bd998c388c4cb0edebc6f47
2017-08-18 11:57:41 -07:00
KongQun Yang 556ff56559 Consolidate MpdParams into MpdOptions
Change-Id: I7f37277ef87597548c2fbf219963cd8725ae4c05
2017-08-18 11:57:41 -07:00
KongQun Yang 4e82ab13bd Consolidate Mp4OutputParams into MuxerOptions
Change-Id: I533e40ef9eb84453c15cbdb7ef42fc85bef5125d
2017-08-18 11:57:34 -07:00
KongQun Yang 9eaf1dcae0 Consolidate ChunkingParams and ChunkingOptions
Change-Id: Ibbb85981d2b424432b61ca693e28334ef00d475e
2017-08-18 11:55:45 -07:00
KongQun Yang c7c201b00c Consolidate EncryptionParam and EncryptionOptions
Change-Id: I8a5b5c329d4731341a3184d50bed061aa00cdeda
2017-08-18 17:37:45 +00:00
KongQun Yang b451d3a7ca Consolidate various playlist_type types
Change-Id: If6fafc0867e7e1f3cd2ed612617e91c7cb144f20
2017-07-21 20:43:14 +00:00
Yohann Connell 8d2b87c773 Adding the ability to provide the group_id in Widevine Cenc requests
Change-Id: I4903cc9422433f20b76d084578d8fc06d7ed45a8
2017-07-20 09:46:25 -07:00
KongQun Yang eb98a87f7d Move packager/media/file to packager/file
Change-Id: Idc0d75a7ceab7c8ce460ef896fdefdec088124bb
2017-07-17 12:08:28 -07:00
KongQun Yang 11210b400a Workaround Edge problem with non-zero clear lead
Somehow Edge requires sinf box to be put after avcC box:
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12658991/

b/37913785

Change-Id: I201c96768328b3910001dba49a9ddda7f06f3c20
2017-07-06 22:48:09 +00:00
KongQun Yang 3bad4ca700 Move status.h under packager/
Change-Id: I4a7f34c575c1c8b9a9a275f3889cf8641cfdd471
2017-06-30 11:35:18 -07:00
KongQun Yang e56d1faaf0 Make HLS with key rotation work
- Remove the TS key rotation not supported check as there is nothing
  to be done for key rotation in TS for SAMPLE-AES.
- Fix IV updated problem in new segments even if crypto period does
  not change.
- Avoid duplicate EXT-X-KEY tags if it does not change.
- Make EXT-X-DISCONTINUITY-SEQUENCE match with number of removed
  EXT-X-DISCONTINUITY.
- Added end to end test for HLS with key rotation.

Change-Id: I73cb82e9f5575fcdf63ee643228efe78e6766302
2017-06-29 21:03:36 +00:00
KongQun Yang 5bad2fbd5c Update the description for @bandwidth to make it clearer
Change-Id: Ib5a084c0ffea9efe0b4173248daddc53498c4498
2017-06-24 01:09:55 +00:00
KongQun Yang b4aa34b803 Support live and event HLS playlists
Closes #114

Change-Id: I6440383c3dc022fba5a9926839f79b9ed8a51f55
2017-06-24 01:09:32 +00:00
KongQun Yang 96ced40ec2 Move command parsing tests into separate class
Change-Id: I6aeba632d69b1867c7d7745f0c8c9fd8f8e275d9
2017-06-20 22:33:55 +00:00
KongQun Yang 03889e6465 Move hex string out of packager.h
Also added validation failure tests in packager_test.py.

Change-Id: I6697a3138d57889110250404205536dd5cd53cd0
2017-06-20 22:33:47 +00:00
KongQun Yang 096c22ee63 Rename shaka::ShakaPackager to shaka::Packager
Change-Id: I493d3a6cf4c27615d1515de7c43dc3c5b8e3224e
2017-06-16 23:08:06 +00:00
Aaron Vaage 0caab0a4b4 Add resolution to HLS manifests
The HLS manifests output by the packager did not have the RESOLUTION
attribute on EXT-X-STREAM-INF tags. This change adds the resolution
tag when resolution values are present.

Close #235

Change-Id: I15ca6de47cb34793cf6a940123d593261627baa4
2017-06-16 01:28:55 +00:00
KongQun Yang 05a5a41969 Support generation of libpackager.so (shared_library)
Shared libpackager can be built by setting libpackager_type to
shared_library, e.g.

GYP_DEFINES='libpackager_type=shared_library' gclient runhooks
ninja -C out/Debug

will generate libpackager.so in out/Debug/lib directory.

Here is a few other changes to make shared_library builds and
tests pass:

- Add several test parameters to packager.h, which is needed for
  testing.
- Create a protoc.gypi from build/protoc.gypi but depending on
  protobuf_full_do_not_use instead of protobuf_lite, since we need
  protobuf_full_do_not_use for text parsing and generation of media
  info proto. Somehow shared_library build does not allow mixed use
  of protobuf_full_do_not_use and protobuf_lite.
- Remove the use of LazyInstance in version/version.cc and use static
  variable directly. This is because LazyInstance needs AtExitManager
  which may not be easy to setup when calling GetVersion.
- Allow skipping testPackageWvmInputWithoutStrippingParameterSetNalus
  with flag --shared_library, which is needed as shared_library build
  does not support --strip_parameter_set_nalus flag yet.

Fixes #227

Change-Id: Iff05a50baa28134faa7218664c96114cb9e70329
2017-06-13 20:42:32 +00:00
KongQun Yang 2816a7262e Integrate packager top level library
Change-Id: Ic2e2ef79d2f5db5aab6565835aaaf6cb1c7e44bb
2017-06-13 13:40:26 -07:00
KongQun Yang db45711750 Implement top level API: packager.cc/h
Change-Id: I2b4fbc0b9f6df5617e9f59173e144c7be1b01d2b
2017-06-13 19:23:34 +00:00
KongQun Yang a0bd3dd565 The retired availability_time_offset flag should have value 0
Change-Id: I6a34c362c0c5252853f0883b54c19c434bd1d8b8
2017-06-01 14:55:16 -07:00
KongQun Yang 19be04ecce Fix git not found on some Windows setups
Change-Id: I0403212f383e60ef75b426170783933f4d73b211
2017-05-26 13:52:42 -07:00
Haoming Chen 32b088c4bc Add sample usage for trick play in README.md.
Change-Id: I1c1f4af37b3573ffdbcc4368826417f1d07da437
2017-05-23 18:33:33 +00:00
KongQun Yang 18cdbd4121 Deprecate availability_time_offset MPD flag
'availability_time_offset' is not an attribute in MPD specification,
but used to calculate availability_start_time to adjust segment
availability time. A similar effect can be achieved with standard
blessed suggested_presentation_delay flag.

If suggested_presentation_delay is not set, player is expected to
choose a suitable value.

Change-Id: I1d540bd4347b4f04b6cc5ec0778e1a5392009b09
2017-05-22 23:14:16 +00:00
sylt bfe302bd5c Add support for skip_encryption stream descriptor (#219)
This option makes it possible to control encryption for specific streams,
e.g. for audio and video separately.
2017-05-22 10:17:58 -07:00
Haoming Chen da8877d8a2 Rename trick play rate to trick play factor.
- Add a "tpf" abbreviation in stream descriptor for
  trick_play_factor.

Change-Id: Ia09313bb9778456b53bdb0a8cc46d2ba8caa2ac2
2017-05-17 21:51:34 +00:00
Kongqun Yang 5fc6e540f3 Include protection_scheme in Widevine CENC request
Widevine license server added support for protection_schemes recently;
If CENC request includes protection_scheme in the CENC request, server
will return with a PSSH with protection_scheme filled in.

Change-Id: I6dcac498b5e039503d6ac0f6e057737f7c53efaf
2017-05-16 01:18:39 +00:00
KongQun Yang d9e7e2f1d0 Generate two sample entries only if there is clear lead
This addresses playready broken with clear lead = 0.

clear lead != 0 is still broken with playready on Edge. We think it is
likely an Edge bug, which does not support multiple sample entry boxes,
thus does not support clear lead.

b/37913785

Change-Id: I7adb77a913dccf669153b03b31b4a1e1c98d1cb0
2017-05-15 14:13:52 -07:00