The previous text to mp4 webvtt pipeline was incomplete. It
did not insert ad cues and it could only insert a segment
after a sample ended.
Now the pipeline supports ad cue insert and segment insertion
mid text sample. This required the pipeline to use the text
chunker (to split samples and insert segments) and required
a major overhaul of the text to mp4 converter.
Before the converter came before the chunker. This meant that
the converter only expected to see stream info and text samples.
Moving the converter after the cue aligner and chunker means
that the convert had to be aware of segments and cues.
The general approach is the same, however the converter will
convert the samples per-segment as the chunker will introduce
duplicate samples if a sample spans across segments.
Closes#362Closes#382
Change-Id: I0f54a40524c36a602ad3804a0da26e80851c92fd
Allow the output file to contain template identifiers like $Number$,
$Time$ etc. Unlike the actual template used in SegmentTemplate, the
identifiers in output will be populated before pushing to the DASH
manifest.
Issue: #384
Change-Id: Ife1caadb6fccd32167fa1bc83fe2afcb2d2ad087
This is needed to support one file per representation per period where
there will be multiple content files generated.
Issue: #384
Change-Id: Ib7af750edf864d99075b8da4f3640217a5a94302
In the text sample box (for mp4) there was a value called
"data_reference_index" that was never initialized. This meant
that it took on various values can caused different results
between runs.
Change-Id: I4b18ac97ec4700f6e651b14898ef250713a4253c
Renamed all the files called "webvtt_output_handler*" to
"webvtt_text_output_handler*" to better reflect the class name
in them.
Change-Id: I977bab362076974a124f263bcefff716ed8b6a0f
The SetUpAndInitialize function returns a status. We were not
asserting that it return an OK status. This change adds the
missing ASSERT_OK calls.
Change-Id: I044f60c0450d46fc0f6495319b1ed7ef8ab6e794
We don't want to allow any handler to be copyable or assigned-over
so this change enforces that for the webvtt output handler.
Change-Id: Ie0d59d6dbfb7a5e00bb4dd1422cd696d1a2d6072
Before, the webvtt output handler was written so that it could
share code between a segmented and non-segmented handler. As
we are not worried about that right now, this change simplifies
the handler to just be about segmented output.
Change-Id: I29dbc4e3a4ffbeb7ea10e23db489ee74b398a6c4
Instead of failing immediately, ignore unsupported audio codec when
parsing the source file, as there may be more than one stream in the
source file. This allows the supported streams to be packaged.
Closes#395.
Change-Id: I01005a93a19012c19065251647c9b06dd25c673a
The Cue class was from a previous WebVTT implementation and
is not used in the current implementation. It was missed when the
other classes were removed. This change removes it.
Change-Id: I661ab3fcd80b5e5ef98b5213746b341a4028d1a1
- Added a new --enable_entitlement_license flag, which sets
'enable_entitlement_license' in Widevine CommonEncryptionRequest;
- Support 'boxes' in Widevine CommonEncryptionResponse.
b/78171767
Change-Id: Id399fc7fcb2948c571e12c8af7687cfcfcef41fe
When originally implementing the webvtt parser, there was a
misunderstanding in what the BOM was suppose to be
(https://en.wikipedia.org/wiki/Byte_order_mark). This corrects the
misunderstanding.
Close#397
Change-Id: I250d392db228e5e9b86684614b57adc5d8a4e5fe
Problem : Text samples have variable length and therefore act
more like continuous samples whereas audio and video
act more like discrete samples. Since we use sample
start time, a cue event could be inserted after the
start time of the last text sample and never get
inserted as there are no more samples.
Change : After all streams have requested flushing, we make sure
to collect all remaining cue events from the sync point
queue and insert them into each stream.
Issue #362
Change-Id: Id8f136f7ef53531f7a7f412613eac352324e0130
Uses protobuf JSON util instead.
packager/base/json_writer comes from Chromium base. We are going to
replace it with abseil, which does not have a JSON library.
The code is much more cleaner now.
This is unfortunately, at the expense of increased output binary size.
packager binary increases by another 100KB.
Change-Id: I83a9217a484cad3c41147ad9a75311384347c49c
Use protobuf utilities instead.
packager/base/json_writer comes from Chromium base. We are going
to switch to abseil which does not have a JSON library.
This is unfortunately, at the expense of increased output binary size.
packager binary increases by about 300KB due to:
- Protos cannot be compiled with LITE_RUNTIME any more.
- Additional protobuf library needed to convert between JSON and proto.
Change-Id: I45a497376925b42d147ffcaabcfc2fa4dbdeacc1
In the cue alignment handler, instead of storing just one cue, store
a full queue. This will make it easier to handle text streams that
end before audio and text.
Change-Id: Ida97008fa015639350261bd3f76f4cb901747c66
In the cue aligner, instead of storing the cue event, store a
stream data so that we don't need to know the stream index when
sending the cue event downstream.
Change-Id: Ice27da021fad2872e2a23975b959630a9d43b736
This is in preparation of supporting entitlement license API, where
common encryption server may return concatenated PSSHs directly.
Refactored ProtectionSystemSpecificInfo into a struct containing
concatenated PSSHs. This will make it easier to pass PSSHs around.
Also, most of the time, users of ProtectionSystemSpecificInfo do
not care what is in PSSH; so moved PSSH box parsing and building out
of ProtectionSystemSpecificInfo.
b/78171767
Change-Id: I1c4d5e7e23efd2f7d4b2b9704378323112e47f00
To make it easier to understand what a video stream and a non
video streams is doing in the cue aligner, each stream type is
given their own functions.
Change-Id: I8b8ca403721bcb06ca3056004420902667a30f6c
Use a common hint for all stream states as the hint is always
updated when we get a new cue event. Cue events are only gotten
when be pass the hint, so there should only need to be one hint.
Change-Id: I0838110b9b10325a9e99f8fca0b11f0a6b48f8a0
To allow generating Widevine / Playready PSSHs if the corresponding
PSSH generator is specified.
Note that Key Rotation with RawKeySource is designed to be used for
testing only.
Change-Id: Icaf9e74955c082a7b000bd6a08f4561f2e01a2e2
Problem: Sending samples to the cue alignmenet handler did
not reflect what was more likely to happen. In our
tests we would send all the samples for one stream
then all the samples for another stream. This created
some special cases that would either not happen in
reality or miss cases that would likely happen in
reality.
Changes: Changes all tests to dispatch samples in an interlaced
pattern that better reflects muxed content.
Change-Id: I985092154b62eb12d95499663d195ca6c103bc19
In H265Parser::ParseSliceHeader, the parser does not handle
byte_alignment() from the spec. byte_alignment() reportedly contains
at least one bit, which is not handled right now.
See Section 7.3.2.12 Rec. ITU-T H.265 v3 (04/2015).
Also added a few size sanity checks in H265Parser to make sure the
code does not crash if an invalid input is provided.
Fixes#383.
Change-Id: I33b31396058fc5ba67a0fc119be5fe56ec9443b0
Packager uses ThreadedIO to write media segments and manifest /
playlists. There was a possibility that media segments write being
delayed and scheduled after updating manifest / playlists.
This CL fixes the race condition.
Also added a note on how segments can be synced to cloud storage to
avoid the race condition during file sync.
Also added a live WebM test.
Fixes#386.
Change-Id: Icf9c38cdec715fa3dc2836eab1511131e129fe41
Fixes#387.
Note that the output will not play in Chrome until the Chrome bug
https://crbug.com/837832 is fixed.
Change-Id: Ic3e917161cedfa773c0a18b4a5d7b1254c6f1313
Problem: The time scale for text was being set to zero in our tests
because it was never needed.
Change: This changes it to use MS as that is what's most common and
requires the least amount of changes.
Change-Id: Ia046ac1994b4cede079d2f801275c7f058d5bdd3
- Allow including Widevine and Common SystemID PSSH boxes
for PlayReadyKeySource.
- --playready_key_id and --playready_key flags are deprecated.
- --enable_raw_key_encryption already supports playready PSSH generation.
Addresses issue #245
Change-Id: I072d4f43a3239875959e4c5b1eb6854415d7367e
To ensure that we can parse content with style and region blocks,
this change updates the parser to skip those blocks so that we
can still parse the cues from a file.
Full style and region support will be added later this year.
Issue #380
Change-Id: I11b8fd862a108c27a5c67b15d4703532b44a1214
Removed the logic in MuxerListener to estimate bandwidth from file
size and duration, since it is not compliant to the spec.
MpdBuilder will estimate bandwidth from segment size and duration
if bandwidth is not specified in MediaInfo.
Here is the statement from DASH spec (23009-1:2014):
Consider a hypothetical constant bitrate channel of
bandwidth with the value of this attribute in bits per second
(bps). Then, if the Representation is continuously delivered
at this bitrate, starting at any SAP that is indicated either by
@startwithsap or by any Segment Index box, a client can
be assured of having enough data for continuous playout
providing playout begins after @minbuffertime *
@bandwidth bits have been received (i.e. at time
@minbuffertime after the first bit is received).
For dependent Representations this value specifies the
bandwidth according to the above definition for the
aggregation of this Representation and all complementary
Representations.
Fixes#376.
Change-Id: I0fddce39e709d0cded0a4c9ae59adbbcc97ec5ea
And for HlsNotifier and SimpleHlsNotifier as well.
This will make it easier to add preserve_segments_outside_live_window
param in a later CL.
Change-Id: I86d464fe247e04574158a0a76e39d8a122960ae4
Content-Type for Widevine key request was incorrectly set to text/xml,
but it should be application/json.
Also added VLOGS for curl calls.
Fixes#372.
Change-Id: I4230795a582112c6d9c12883b5e61481b63284aa
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
The WebVtt Output Handler did not recognize cue events. This change
allows the handler to accept the events and tell muxer listener
about them.
Issue #362
Change-Id: I7c3318b72e539adc19af587c8e213fdb0af8290b