- Part 1.
- Add packager command line argument "protection_scheme" to specify
protection scheme. Plumb through packager code to enable CBC
encryption/decryption.
- Add scheme type "cbc1" to sinf.
- Refactor AES encryptor and decryptor.
- Need more work in the subsample handling.
Issue #77
Change-Id: I3a9304d89adf5efbfb226b6e805a3077b6cb8c68
* EncryptionKey now contains them rather than a PSSH box.
* Outputs PSSH boxes for each entry.
* Outputs a ContentProtection element for each entry.
* Removed SystemName and UUID from KeySource.
* Removed --scheme_id_uri packager argument.
Issue #88
Change-Id: I2651784c3220fd64f5b1773fdcd70285690cf8c0
This adds a new function to key AdaptationSets based on the
characteristics that require separate sets.
With this, we are now able to package multi-codec assets at once
(AVC1/MP4 and VP9/WebM in the same manifest, but in different
AdaptationSets).
Fixes b/27534371
Change-Id: Ie82fd096d2ef99fd23e323d60fd0849b1e8d7500
When normalizing language tags to their shortest form, we need to
split off subtags and treat them as separate components that do not
get changed.
Furthermore, MP4 can only store language tags without subtags. So
only store the main language in MP4 output.
Fixes b/27533973
Change-Id: I96049e274aae9841e321c53039ef6464a2e61574
Add another overload to fetch by key ID directly, used by WebM.
Changed the one using PSSH data in favor of the entire PSSH box.
This also moves the Widevine proto to media base. Now, the
Widevine key source handles creating the Widevine specific PSSH
data.
Change-Id: I6f4633facad39207809ffbad970635d1f9d70983
This moves pssh parsing to its own class in media base. This type
can be used to parse and generate pssh boxes. This new type also
supports both v0 an v1 boxes.
This also modifies the pssh box definition to only have the |raw_box|
and moves all pssh parsing and handling into mp4 media parser.
A follow-up change will replace the remaining usages of 'raw' pssh
box data with the new type.
Issue #88
Change-Id: Ic2436ecb5df8b3558b81e600dc095b0efd122ab1
This moves common parsing code out of the H.264 parser. This is in
preparation for the H.265 parser to use.
Change-Id: Id05b55f6adc2ea31e97c8a9f22023e851808a8a7
Now the AVCDecoderConfiguration and HEVCDecoderConfiguration classes
will read the Nalu from the blocks, meaning they will store a
vector of Nalu objects for the data.
Also added H.265 to the Nalu class and added argument to NaluReader
to read H.264 vs H.265 Nalus.
Change-Id: I8d8194a90fd72a30af66e9776e01379f8428542c
This is needed to test encryption in end to end test since the video
is segmented in gop boundary by default. Due to the existence of clear
lead, the first segment is always left in clear.
Change-Id: Ie8d37a1740f9061515298cb9fb7b58983592cc5b
This member refers to the size of the payload (the data after the
header). Since the pointer is called |data|, calling this size
|data_size| is confusing.
Change-Id: I9174cf6c5c402beddaebbce7c16514470ba0c3da
Now the Nalu data pointer points to the start of the NALU header
rather than pointing to the start code. Added a new method on
NaluReader to check whether the stream starts with a start code.
Change-Id: Ifaecbe0c911aa5cffdf0a966028e6cada8621cc3
For non-video slices, the data is not encrypted. This also skips the
frame headers for H.264; support for H.265 will be added later.
Issue #40
Change-Id: Id0cb0fb9ddb6adedf63ef4aef6b3a26260a21654
Removed the code for NALU splitting in the H.264 parser and moved
it to its own class. Also added support for length-prefixed
NALU splitting for use with the encrypting fragmenter.
Change-Id: I1e91266681f1b117fb2382cf80590651efc06619
Parse channel layout value from dec3 box. Pass it through audio stream
info. MPD builder forms audio channel configuration to signal ec-3
codec.
Specs: 1) ETSI TS 102 366 V1.3.1 Digital Audio Compression (AC-3,
Enhanced AC-3) Standard E.1.3.1.8.
2) DASH-IF Interoperability Points v3.0 9.2.1.2.
Issue #64
Change-Id: Ia2c22dd3d82e757ba5a88ba1de35c5d593f5005e
Before this change, the media file will fail to be parsed if it contains
non-wvtt text streams. This change allows demuxing of video and audio
streams in these media files even though the text stream is ignored.
Fixes#74.
Change-Id: I7ef108a51125c4965fe48c39efe9638f3a0e4759
This also changes the way frames are written in the WebM muxer. Now,
frames are stored and written on the next call to AddSample. So each
call to AddSample will write the previous frame. This is needed to
determine whether the given frame is the last one in the cluster.
Closes#70
Change-Id: Ic69ebad3c4729cdaa2017c9c7f497048501ac907
Create a new MacOSX configuration for curl:
- Add a curl_config.h created on MacOSX
- Add a find_curl_ca_bundle.sh that searches default folder from Homebrew and MacPorts for a ca bundle.
To find the files either install OpenSSL from Homebrew or MacPorts, or Curl from MacPorts.
When gyp is generating the ninja files a circular dependency error is reported:
packager/media/file/file.gyp -> packager/media/base/media_base.gyp -> packager/media/file/file.gyp
This isn't a problem with ninja, but presumably is a problem with Xcode.
Change gyp_packager.py to use "--no-circular-check" for all generators except xcode
When generating ninja files we end up with two libwebm targets.
packager/media/formats/webm/webm.gyp:webm -> becomes target libwebm
packager/third_party/libwebm/libwebm.gyp:libwebm -> becomes target libwebm
Solve this conflict by renaming libwebm.gyp:libwebm to mkvmuxer.
There is a target name conflict between packager/base/base.gyp:run_all_unittests and
media_test.gyp:run_all_unittests. Change to media_test.gyp:run_tests_with_atexit_manager to
resolve the conflict.
On Linux the generated ninja files use path/libbase.a as target name.
In the Mac ninja file the target is just libbase.a.
As we have two libbase.a (base/base.gyp and media/base/media_base.gyp) the linking stage fails to include both libs.
Solve by renaming media_base.gyp's base target to media_base
For WebM contents, it is possible that we may receive some NewSampleEvent
before receiving ParserInitEvent. This is because init event is fired
after analyzing a video block which could come after an audio block.
Also modified Flush() function to return a bool to indicate whether the
the flush is successful and whether the samples are handled correctly.
And added macro to ensure Flush() and Parse() results are handled.
Fixes#71
Change-Id: I2294d6f529f54e4578344916559bb1bc116c745a
Now outputs cenc:default_KID attributes on all ContentProtection
elements for non-MP4 streams. For MP4 streams, it will still output
the default ContentProtection element.
Closes#69
Change-Id: I38b24297aa3c2ccbcbde38b44279b56c37a388f7
- Also refactor decryptor management code out of mp4_media_parser.cc
- Move decryptor managment logic to DecryptorSource class to make it
available for webm as well
- Remove data_offset member from DecryptConfig which is not useful
- Add widevine_pssh_data.proto file
Closes#72
Change-Id: I1d32baf4013ebd3382b5372c7433fae5033a260e
- dts was not set earlier, although for WebM, we could assume that
dts is the same as pts.
- Calculate block duration with the difference with the next block
if duration is not encoded, even if track default_duration is set.
- Use track default_duration as a duration estimate for the last
block.
- This also removes opus duration computation from encoded data.
Issues #67, #68
Change-Id: Icaa2769dcb2a89269ae014f44ad6a9262770aed2
- Box definitions for box type DEC3.
- Parser/muxer changes to support Enhanced-AC3 audio codecs.
- MPD signaling will come in Part 3.
Issue #64
Change-Id: Ifcd5efa1f61b470ec225127925631e4329853259
This does not support key-rotation and will give an error. This is
because WebM does not have a way to indicate a change in key ID using
media segments.
b/22463551
Change-Id: I9b3dac818dc370302a5afc0d25d8a060b64d30cd
- Check if 'output_dir=' is already defined in GYP_GENERATOR_FLAGS
before appending the one generated in the script.
- Reusing out/ with different GYP_DEFINES causes everything to rebuild.
- This change allows the user to use different directories for different
GYP_DEFINES; it can make sanity checking faster for different
GYP_DEFINES.
Change-Id: Iffa6880381dabdd80a3aa7777a1d20cc3900f3e3
- From DASH spec 2014, MPD@publishTime and Period@id are required for
'dynamic' MPD.
- Period@id is always set to "0".
- MPD@publishTime is set to the time when the MPD is output.
Issue #55
Change-Id: I5e50aa11067176e69a2343fbc82ca42129703e1b
Added packager tests for WebM audio. Also now only outputs the
language if it's not empty. Fixed the packager tests for that.
b/26540606
Change-Id: Ica804bd710055bcaa2113f948d723dedd78ef909