The spec actually requires all NAL units to be escaped, so there
is no need to escape it again.
NAL byte stream is one demarcation method; NAL unit stream is another
demarcation method. Regardless of the demarcation method used, the
requirement for NAL unit is the same. See the last paragraph of
7.4.1 NAL unit semantics on the requirement on emulation prevention bytes.
Change-Id: Icc63fcc5cf965632e331f5af5f673164c7c1663a
CENCv3 recommends only encrypting video data in slice NALs. Slice
data partition NALs should not be encrypted.
In the code, differentiate is_vcl and is_video_slice. They are the
same for H265; for H264, vcl NALs include slice data partition NALs
but video_slice NALs do not.
Change-Id: I91f4bdd76d25f0eac50e39aed350ebce3f667121
- Logic for splitting up WebVTT cues into MP4 samples.
- For any cue intervals that overlap, a new sample must be created.
Change-Id: Icf7478f42d8c5790bf6f404d512c1251dd34c405
This handler is a multi-in multi-out handler. If more than one input is
provided, there should be one and only one video stream; also, all inputs
should come from the same thread and are synchronized.
There can be multiple chunking handler running in different threads or even
different processes, we use the "consistent chunking algorithm" to make sure
the chunks in different streams are aligned without explicit communcating
with each other - which is not efficient and often difficult.
Consistent Chunking Algorithm:
1. Find the consistent chunkable boundary
Let the timestamps for video frames be (t1, t2, t3, ...). Then a
consistent chunkable boundary is simply the first chunkable boundary after
(tk / N) != (tk-1 / N), where '/' denotes integer division, and N is the
intended chunk duration.
2. Chunk only at the consistent chunkable boundary
This algorithm will make sure the chunks from different video streams are
aligned if they have aligned GoPs. However, this algorithm will only work
for video streams. To be able to chunk non video streams at similar
positions as video streams, ChunkingHandler is designed to accept one video
input and multiple non video inputs, the non video inputs are chunked when
the video input is chunked. If the inputs are synchronized - which is true
if the inputs come from the same demuxer, the video and non video chunks
are aligned.
Change-Id: Id3bad51ab14f311efdb8713b6cd36d36cf9e4639
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
- 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
- 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
- Add MSVS related patterns to gitignore.
- Removed encryption_modes.h from media_base.gyp. It doesn't exist.
Change-Id: I44bc86ff7e79daf6f7bc61c21a558937530d8e66
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
- nalu_data points to the beginning of the nalu, instead of
beginning of the slice header which excluded the nalu
header.
- nalu_size is the size of the whole nalu.
- header_bit_size calculation is corrected. The size used to exclude
emulation prevention bytes.
Change-Id: Ic00f42caeddf7b4701f3948e6ef8a3537fd7f770
- If OnEncryptionStart() is called OnMediaStart(), someone should be
calling NotifyEncrytionStart().
Fixes#169
Change-Id: I597f317d2ddeb3091b7e9d238eb9695b4cc9c69d
Three options are supported right now:
- reuse=1|0
Allow or disallow reusing UDP sockets. Default 0.
- interface=a.b.c.d
Address of the interface over which to receive UDP multicast
streams.
- timeout=microseconds
Timeout in microseconds. Default to unlimited.
A UDP url should be of the form udp://ip:port[?options], here
is an example:
udp://224.1.2.30:88?reuse=1&interface=10.11.12.13&timeout=12345
Also deprecate --udp_interface_address flag in favor udp options.
Closes#133
Change-Id: I962d35bfedc1779d67ba20ed910207c66b7c1a15
1. Allow encryption pattern of 0:0, which is treated as 1:0;
2. Remove the special handling of pattern 1:0 in pattern cryptor
which may not always be correct;
3. Allow senc/saio/saiz boxes to be absent.
Change-Id: I372e61182ec577107e39cb601c3aed80616b036d
The original code creates temporary file in the current directory,
which may not always be writable.
Change-Id: Icc278dd5db6be6206ae29defbb7423bae39cc978
- Also import the version of the protobuf bundled in packager first,
this avoids importing the installed version of the protobuf, which
may not be compatible with this script.
- Print help if no argument is supplied.
Fixes#162
Change-Id: I1b5e87ba7fb51e81b0d4dd3791aaeb37ee0fd6ce
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
The original code accumulates sample durations in seconds (double)
and then generates new segment / cluster by comparing the accumulated
value with configured value.
There may be loss of precision when accumulating values in double.
For example, with a GOP of 96 frames and frame rate of 24 fps; the
accumulated frame duration for 96 frames is 3.999999999999, which is
very close to 4.0 but not 4.0. Problem would arise if segment
duration is set to 4. The created segments would have a duration of
8 seconds instead of 4 seconds.
The new code accumulates sample durations in uint64_t relative to
input time scale; the configured segment duration will be converted to
timescale for comparison. This avoids loss of precision.
Change-Id: I3ae24be82a7ce45f923a6f90fea495b8b6b2e7ef
Setting this flag will tag any matching tracks with kRoleMain.
The player will then know which tracks should be default when there
is not a language match.
Closes#155
Change-Id: I827304c49e345d07b1e76f7a46421b60f228f0ba
Language tags can have subtags, such as "por-BR". While the base tag
should be 3 characters, the entire tag can be longer. Rather than
parse out the base tag and check that it is size 3 without the subtag,
we can just trust the ISO tag converter to do the right thing.
Change-Id: I2a186b5c8db0f373ee82ef68245ecc33cb068581
Some subtitle files use .webvtt instead of .vtt, probably because
ffmpeg uses -f webvtt when converting from some other format.
Change-Id: If88e8d2b90e5dea6751409568d5191e923dec4aa
- 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
- Add decrypt_config in media sample and stream.
- Update subsamples when converting NAL unit to bytestream.
Change-Id: I7b8975a453f81b22cf74bee3c9a58b7e458cbaae
1. Add Windows support in README.
2. Add a useful links section in README.
3. Set line length to 80 characters in README; if exceeded,
will wrap to a new line. This won't affect the presentation
for the markdown.
4. Include the content of Chromium.License in License file.
Change-Id: I67f6d5935b46bc05fbcbf0a608aca9b0ae167173