Commit Graph

76 Commits

Author SHA1 Message Date
Haoming Chen 4ba5bec660 Integrate trick play.
- Add trick play adaptation in mpd. This addresses #178.

Change-Id: Id6cc08c788eda074c261d0274768051837b84541
2017-05-09 13:33:11 -07:00
KongQun Yang 1e2da22c88 Add support for WebM colour element
Change-Id: I359cde97171118d3b928a9dd6650d11fade8f4a9
2017-05-02 20:22:17 +00:00
Kongqun Yang 4a47268f3d Fix avc3 codec string problem
- Added wvm decryption and demuxing test
- Added avc3 test (not strip parameter set nal units)

Change-Id: I28ff4d7f9ef539eafe45cfadfc0912cd11c72b05
2017-04-28 19:24:11 +00:00
KongQun Yang 59f393779c Support v1 vp9 in iso-bmff
- Implemented according to v1.0 spec @ https://www.webmproject.org/vp9/mp4/
- v0 is no longer supported

Change-Id: I189c813d788400beda797eea7da943a83dfa7d79
2017-04-27 19:37:14 +00:00
KongQun Yang 4d81979b16 Add -v and --vmodule flags in test script
The flags will be propagated to packager binary if set.

Change-Id: I38aa9f4fb8e23f7a802d4114b5507035ef0cc583
2017-04-26 10:25:28 -07:00
Rintaro Kuroiwa 9d101f85e3 Print the failing command if subprocess.call() fails
Change-Id: Ib640b590e259a1a9bd44030ae13611cd359721e0
2017-04-18 16:33:35 -07:00
Kongqun Yang 75a4b55b34 Fix AAC-HE not correctly signaled in codec string
- Also fixed a bug with dts audio in esds.

Closes #225

Change-Id: I50ca731ac81bedfec37b0e2d577c51d643b7a839
2017-04-13 23:40:23 +00:00
Rintaro Kuroiwa c2e019ed31 Output command line when packager tests fail
- Changed python packaging test to output the command line it ran for
  tests that failed.

Change-Id: I52c06bcec725c9dce7f845ab138cfab29b582201
2017-04-05 20:05:01 +00:00
Kongqun Yang d007ddf20b [MP4] Make outputs CMAF compatible
- Added flag --mp4_include_pssh_in_stream, default to true. If it is
  set to false, the encrypted mp4 stream will not include pssh.
- Align BytesOfProtectedData to multiple of 16 bytes for cenc.
- Set TrackHeader flag to kTrackEnabled | kTrackInMovie |
                          kTrackInPreview
- Move mvex to after trak, required by HLS
- Add cmfc/cmfs compatible brands except for avc3/hev1, where CMAF
  requires single initialization switching set which is not supported.
- Set duration to 0 in tkhd, mdhd, mvhd.

Also updated major_brand and compatible brands:
- Set major_brand to isom (iso-bmff media file format) and made dash
  a compatible brand
- Replaced compatible brand iso6 with iso8 since we use sthd for text
  tracks

Fixes b/36278260

Change-Id: I3cc5dd5aa1621714d517fe02fe3841d19a1a07f6
2017-03-30 15:33:39 -07:00
Kongqun Yang 1af8f04e40 Rename webm_subsample_encryption flag to vp9_subsample_encryption
This is what webm_subsample_encryption flag actually does.

- Fixes the flag not working problem introduced by previous CLs.
- Also mark flag webm_subsample_encryption as deprecated.

Closes #220

Change-Id: I03ff843786572a91c01b8bd346a3ce50b129118f
2017-03-30 20:36:43 +00:00
Kongqun Yang ec904f3f79 Add a new test to exercise emulation prevention after encryption
Also added a few more command line flags for end to end test:
- no-remove_temp_files_after_test: do not remove test artifacts after
  test
- encryption_key, encryption_iv: allow injecting encryption key/iv from
  command line

Change-Id: I62084790e10fe6a385b90cb96d9515d8436b2a49
2017-03-28 13:18:33 -07:00
Rintaro Kuroiwa 4891d9a6bf HLS with fragmented MP4
- Add EXT-X-MAP tag for init segment.
- Do not set output field on stream descriptor if not specified on
  command line. If it's set (internally) then it gets copied to
  MediaInfo that gets passed to the manifest generators.

b/36279481

Change-Id: I762c55b255699ec691817dc4806b0dee2f7504b8
2017-03-27 13:20:03 -07:00
Kongqun Yang b891e0271e Make CENC behavior of VP8/9 in ISO-BMFF the same as in WebM
- Disable subsample encryption for VP8 in ISO-BMFF
- Apply block alignment to all subsamples for VP9 in ISO-BMFF,
  instead of just superframes.

Change-Id: I8dd31cc16e87abc4d538330eaff9acb0509497df
2017-03-21 23:12:57 +00:00
Kongqun Yang 160700b452 Integrate ChunkingHandler
Also moved MediaHandler output validation to Initialize instead.

This CL also addresses #122 with consistent chunking.

Change-Id: I60c0da6d1b33421d7828bcb827d18899e71884ce
2017-03-16 20:54:36 +00:00
KongQun Yang 8f2cd6da91 Implements Demuxer and Muxer media handlers
- Also sets up the packaging and verify it works.

Some of the changes are temporary to get the integration going.

Change-Id: I0cf6c379d185e157808acabb9ef58ff93d4a39ae
2017-03-08 19:11:52 +00:00
Kongqun Yang 6235352bf4 Fix mpd duration not set in static live manifest
Closes #201

Change-Id: Ie9ab58ec58e1b135931a6576fb46145454b0f049
2017-02-11 00:52:32 +00:00
Kongqun Yang bee59bc2fc Enable generate_dash_if_iop_compliant_mpd by default
This will move ContentProtection element from Representation
to AdaptationSet.

Shaka Player already supports AdaptationSet switching
urn:mpeg:dash:adaptation-set-switching:2016;

ExoPlayer does not support it yet. Filed
https://github.com/google/ExoPlayer/issues/2431 to track the issue.

(ExoPlayer does not like having ContentProtection in Representation
anyway)

Closes b/34691105

Change-Id: I69d0a4d0e15a912a35c8b2686620419a28e4cc99
2017-02-09 11:12:21 -08:00
Kongqun Yang 80c54a533a Update cmd flags to support static mpd with live profile
- Deprecated command line flags --profile and --single_segment.
  'segment_template' in stream descriptors implies live profile
  and non-single segment.
- Added flag --generate_static_mpd_for_live_profile to generate
  static mpd for live profile; if not set, dynamic mpd will be
  generated.

Close #142

Change-Id: I78879297ed118f0f246c4753a16ad125bd6b5e4f
2017-01-13 20:00:10 +00:00
Kongqun Yang 5aaae303e8 Part one of supporting live profile with static mpd
- Added two new fields in MpdOptions: dash_profile and mpd_type
- Updated MpdBuilder to support LiveProfile with static mpd
- Command line arguments will be updated in the next CL

Issue #142

Change-Id: Ibd35e5c9e1b1ef98043392e3f04a0af4700135c1
2017-01-13 19:59:49 +00:00
Kongqun Yang af0904e428 Fix AdaptationSet switching signaling
Current mechanism of using AdaptationSet @group is not spec compliant.

The spec compliant mechanism is to use supplemental descriptor with
schemeIdUri: urn:mpeg:dash:adaptation-set-switching:2016 as specified
in ISO/IEC 23009-1:2014/Amd.4:2016.

Fixes #156

Change-Id: I4d97648547a23315ba9c09dcadb14e18c99a45fc
2016-12-19 20:12:27 +00:00
Kongqun Yang d8d94da250 Fix packager_test break in Windows
Change-Id: Id43e4bd0e2067fd9ad74f8c5c60df7ddba75e840
2016-12-09 19:11:04 -08:00
Kongqun Yang c8ffa54d35 Fix --version in drive programs
Fixes #176

Change-Id: Ib092f81e1af49dfee43f7b01c0008a1b40c9098b
2016-12-08 14:45:05 -08:00
Kongqun Yang 97fc9828f0 [WebM] Move index segment after init segment
Cues used to be generated in the end of the file; if http range
request is not supported, clients have to download the whole
file to get to the cues.

This CL updated TwoPassSingleSegmentSegmenter to write cues
after writing webm header.

This CL also updates libwebm dependency to latest.

Closes #159

Change-Id: Ic73548e1b872e6b13a37627707e7d0ff3e556877
2016-10-01 00:34:56 +00:00
Kongqun Yang f5dc908a0d Implement utility function DoubleToString
Implement our own DoubleToString as base::DoubleToString uses
third_party library dmg_fp.

Change-Id: I0d3d706cfd3de4f833b201110954419e585a21dd
2016-09-30 21:36:11 +00:00
Kongqun Yang 5edd290694 Fix WebM not encrypted when clear lead is set to 0
- Also regenerated test content to insert an iframe every one
  second: ffmpeg -i source.webm -auto-alt-ref 1 -g 30 out.webm
  This makes sure the content is actually encrypted with one
  second clear lead in end to end test.

Change-Id: I488143c148e2d6c45ba1586f6d0d835dc46db86e
2016-09-28 18:17:09 +00:00
Kongqun Yang de9667080f Do not partially encrypt a segment
Mimic iso-bmff behavior: either all the samples in a segment are encrypted
or all the samples are clear.

Change-Id: I03bdbbf5a4b690f4d87c4dceb0f8155e6fae941e
2016-08-19 14:22:40 -07:00
Kongqun Yang d501b457d0 Fix WebM keyframe detection in BlockGroup
The right way to detect the presence of a keyframe in a BlockGroup
is to look for the absence of the ReferenceBlock element [1].

Closes b/30433206

[1] https://matroska.org/technical/specs/index.html#ReferenceBlock

Change-Id: I2b3c8704cbabcd5cbee38448e5528425865561a4
2016-08-18 23:20:40 +00:00
Thomas Inskip db92c9a22b Implemented WebM VP9 subsample encryption and decryption.
Change-Id: I98f02c05ec8bcc976e01ff41478e92b8809c0076
2016-08-18 13:55:36 -07:00
Thomas Inskip 336ea5cb34 Windows build working
Change-Id: I6d9cfa0a310c4c6125c839e4d6a085903e981c9c
2016-08-18 08:30:26 -07:00
Kongqun Yang ad95b9d8de Fix text formats not recognized problem
Also updated packager_test not to fill in output_format by default,
which will help catch these kinds of bugs.

Closes #130

Change-Id: I77157317de822d3f543f7e27d94bb4df7a1649d2
2016-07-22 20:51:16 +00:00
Kongqun Yang f3d35b730c Add version information to generated HLS manifests
- Also refactor the existing version code.

Change-Id: Ib409630c4f87965a37b1d6a1bcec68178a704ce6
2016-07-11 23:26:36 +00:00
Kongqun Yang e0c5874d31 Update encrypted testing content to use common system id
- Also fix a bug in fixed key rotation with empty pssh_data.

Change-Id: I1110b839fc821c5c4778854c0b29032d3ee2d384
2016-07-11 20:10:31 +00:00
Kongqun Yang 5f0d138ec9 Adjust hls descriptor validation
- Try to determine container name from segment_template if output is
  not specified
- segment_template descriptor is required for TS
- output descriptor should not be specified for TS
- Generate hls_playlist_name from stream number if not specified
- Update packager_test.py to include playlist validation

b/29551186

Change-Id: Ide7169f1c26c85a6e38272dda0e1af77135b4d90
2016-07-01 14:14:24 -07:00
Jacob Trimble 6550868574 Add codec private data to VP9 in WebM.
b/29009350

Change-Id: Iaafc87340043eff77c3ef7e1c1135d8c4c4287ae
2016-06-22 16:43:57 +00:00
Kongqun Yang d08f6ae0cc Fix cbcs/cens behavior when applied to non video tracks
- Tracks other than video are protected using whole-block full-sample
  encryption as specified in ISO/IEC 23001-7:2016(E) 9.7, which is
  equivalent to a pattern of 1:0. This is different to the non pattern
  encryption counterparts.
- Also updated the code to allow the existence of other protection
  schemes in the original content, which will simply be ignored.
- The internal cryptor used by AesPatternCryptor should not use
  constant iv, add a DCHECK for that.
- Optimize AesPatternCryptor handling on the special pattern 1:0.

Change-Id: Idc704e7bc6b347741336f38c6d3620fc19392960
2016-06-08 17:02:26 +00:00
Kongqun Yang 579678d6a6 Fixed a Opus in Mp4 parsing problem
- Also added end to end test in packager_test.py

Closes Issue #83

Change-Id: I7a8e695a36e654507b75d558710db1ce8867a916
2016-06-01 23:52:33 +00:00
Kongqun Yang 68aa1397b0 VPCodecConfiguration box should inherit from FullBox instead of Box
Change-Id: If53c6cab009bdeadc37a1bac34272056a2b7d1dc
2016-05-25 23:59:16 +00:00
Kongqun Yang 72c3a76699 Update repo url in version string
Issue #103

Change-Id: Iec7db3d155c81cf989f1078ed32692f8e037aa65
2016-05-24 21:55:45 +00:00
Kongqun Yang 26cb91e29b Handle preroll and codec_delay when tranmuxing opus
Closes Issue #102

Change-Id: I26aa56a63c17c85298311cc17963dd26f26e501e
2016-05-16 14:51:51 -07:00
Rintaro Kuroiwa 7d8322377e PMT writers for H264 and AAC
- For encrypted segments, PMT specified by SAMPLE-AES specification is
  generated.
- Remove time_scale_ field from TsWriter. It is not used.
- Move ContinuityCounter to a separate file.
- Add ProgramMapTableWriter and implementations.
- continuity_counter is incremented for PAT and PMT.

Change-Id: If0dd0990203cb6990f39a6832048bdc3ff08decd
2016-05-05 15:56:54 -07:00
Kongqun Yang 2abc7c60b7 Add end to end test for transport stream
- Also replaces resolution to 640x360, to reduce file size.

Change-Id: I030ceaa0c67c2b8f060d1864e2c3150f5d28b612
2016-04-29 17:21:08 -07:00
Kongqun Yang 3ff74398df Fix two bugs in 'cbcs' and 'cens' handling and add tests
- BytesOfProtectedData in 'cens' SHALL also be 16-byte aligned
- Fix an incorrect box definition bug w.r.t to 'cbcs' and 'cens'
- Also add various protection scheme tests

Close #77
Close #78

Change-Id: I63c8d8b01ce16ed60affa97ec95fc62bc2da06df
2016-04-26 17:27:26 +00:00
Kongqun Yang 976bf69294 Add decryption verification tests
Change-Id: I735dc14c618537bc4a69fcfbe2bc634bfe2a2166
2016-04-26 17:27:13 +00:00
Kongqun Yang 855d1b028f Correctly generate ContentProtection value for non-cenc protection schemes
Change-Id: Ie5469a7f192cc6167f029befd9cca7f9ab0d1f27
2016-04-26 17:27:04 +00:00
Kongqun Yang 797ae3e639 Copy packager_test.py to out directory on build
- Disallow packager_test.py to be executed from source directory
- Remove the building of packager target from packager_test.py. User
  need to make sure packager builds successfully before running
  the test.
- Remove build_type parameter which is no longer needed

Change-Id: I479d3c39b8d45730e5388d194069f1320fa5cd75
2016-04-22 18:16:33 +00:00
Jacob Trimble 40e1cc87d1 Fix bug in WebM SeekHead.
The positions in the SeekHead element should be relative to the
Segment payload, not the start of the file.  Also added entries for
Tracks and SegmentInfo.

Change-Id: Id692da25fffc27d78e9f1a06d061431aeb6f1e7c
2016-04-04 15:50:55 -07:00
Jacob Trimble fe6775a509 Fixed off-by-one bug in WebM muxer
There was a bug in the single-segment WebM muxer where the index
range was incorrect.

Closes #99

Change-Id: I7cde98f9b5e88615fcf0ab406b22f65f0b14e15f
2016-04-01 16:26:41 -07:00
KongQun Yang a2438554f6 Fix gpylint errors on packager_test.py
Change-Id: I28074c4e9270279ebb83f64b2f9f615b4f705079
2016-03-29 17:37:58 -07:00
Jacob Trimble cdcfc4c44b Added H.265 parser.
This adds a preliminary H.265 parser.  The parser only support
reading the slice header.  This also attaches the H.265 parser to the
VideoSliceHeaderReader so H.265 frames can have unencrypted headers.

Issue #46
Closes #40

Change-Id: I8b98e1f8bb04e359d9bf896fd5b2939c326b196b
2016-03-29 20:21:46 +00:00
Rintaro Kuroiwa 94b4c52bf5 packager test should respect builddir_name
- Use 'builddir_name' environment variable to create the output
  path in test_env.py
- This allows running the packager test with different build
  configs because it doesn't use 'out', e.g. it could use 'out_clang'
  for clang builds.

Change-Id: I843343ec8e2d0a64dffbab2fdbd38aead5c97718
2016-03-26 16:42:00 -07:00