Commit Graph

1281 Commits

Author SHA1 Message Date
Aaron Vaage
dbce84f3ea Remove Time Scale Assumptions From Text Chunker
Before, the text chunker would assume that all text streams were in
MS, which is not a safe assumption to make.

This changes it to take the time scale from StreamInfo and work
natively with scaled time units.

This required updating the tests. While doing so the tests were
rewritten with the goal to make them easier to read.

Closes: #399

Change-Id: Ib792ad306f40d749763418cde645337913a6046b
2018-06-13 17:43:49 +00:00
Aaron Vaage
30b189cb99 Make Test Util 'GetTextStreamInfo' require Time Scale
Make the text stream info factory method in media_handler_test_base
require the caller to specify the time scale.

Issue: #399
Change-Id: Ibdfb183e0aa3f4ff50edf6b58c4e9b966006c6d2
2018-06-13 17:43:35 +00:00
KongQun Yang
55cc50baa0 Use new vp09 codec string for WebM by default
Configurable under flag --use_legacy_vp9_codec_string, which defaults
to false as all major browsers and platforms support new style vp09
codec string already.

Closes #406.

Change-Id: I22e917777f9d66db815ff9d55eb47b6d55806269
2018-06-12 23:31:28 +00:00
KongQun Yang
e5863f1e0e Warns if HLS type is not set to LIVE for UDP inputs
- Also fixed documentation missing --hls_playlist_type LIVE for HLS
  live examples.
- Also updated packager.cc to use RETURN_IF_ERROR macro for
  consistency.

Fixes #347
Fixes #403

Change-Id: Idbccd7137b873170cd54e2c780bd554d25031a0b
2018-06-07 20:47:57 +00:00
Aaron Vaage
9df2825f3d Remove WebVTT Mp4 To Mp4 Path
Since the WebVtt mp4 to mp4 path did not include all the features
we needed and we know of no-one who is asking for it. We are opted
to remove the path so that there will be an error rather than
incorrect output if they try to use it.

Issue #405

Change-Id: Id2c37bb385c514dd8e31f7d3bd75fb3904b70d78
2018-06-07 11:13:54 -07:00
Aaron Vaage
cc1d4b765a Set Box Definition Defaults in Header
To ensure that every variable in a box is explicitly set
every variable has been assigned a default in the header.

Change-Id: Iaa806c4058ac6621a64363a00040fbd9903c6710
2018-06-04 23:14:59 +00:00
Aaron Vaage
47f20031dd WebVtt Text to MP4 - Test That No Payloads Becomes Gaps
Text Samples with no payload should be ignored, so this adds a
test to check that samples with no payload get treated the
same as a gap.

As long as this case is true, using gaps in our other tests should
functionally be the same as using samples with no payload.

Change-Id: Ic16b240c43eda2514b537a2d938d4135638adc4e
2018-06-04 22:10:44 +00:00
Aaron Vaage
e96fe3aedf WebVtt Text To MP4 - Explicitly Set Payload In Tests
Before we used the sample payload for each text sample as we were
focusing on the times rather than the contents.

As we look to add tests that rely on specific sample payloads, we
need to change the tests to explicitly set the payload for each
sample.

Change-Id: I24174686f46535cf6c2d59a18308101a3bb51c87
2018-06-04 22:10:39 +00:00
KongQun Yang
55050fe6b5 [Ad Insertion] Avoid adjusting EPT except for the first file
EPT (earliest presentation time) may be adjusted not to be lower than
the decoding timestamp (dts), but the adjustment should only be done
on the first file when there is one file per Representation per Period.
The second file and onwards should not be adjusted otherwise a GAP
would be created.

Closes #384
Closes b/78517422

Change-Id: I56771ad8fbbe6a87b832ec58854cfbf37d5f1817
2018-06-01 15:53:02 -07:00
Aaron Vaage
2c1faa71a0 WebVTT Text to Mp4 - Verify Media Sample Contents
In our text to mp4 tests, we were only checking if the times on
the samples lined-up with what we were expecting.

We want to check that text sample contents (ids, settings, and
payloads) were correctly merged into a single media sample. To
verify this, we now check if the sample ids appear in the
media sample.

Change-Id: Ica1a85a14e7b116275e3571332b2e90d7bc44c45
2018-06-01 20:43:16 +00:00
Aaron Vaage
668bae314f Add Unique Sample Ids in Text to MP4
In our text to mp4 tests, we used the same sample id for each sample,
this changes it so that each sample (within a single test) has a
unique id.

This is done in preparation to look for the ids in the created
media samples.

Change-Id: I3215a6f09279af8f40e1ce8a959e0a522a811173
2018-06-01 20:42:50 +00:00
Aaron Vaage
b9dee56294 Rebuild Text WebVtt to MP4 WebVtt
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 #362
Closes #382

Change-Id: I0f54a40524c36a602ad3804a0da26e80851c92fd
2018-06-01 19:49:56 +00:00
KongQun Yang
6e4820eedc [Ad Insertion] Support one file per Representation per Period
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
2018-05-31 23:59:21 +00:00
Aaron Vaage
9feb2bf503 Remove Files That Should Not Have Been Committed
Removing files that we accidentally committed to the repo.

Change-Id: I07ec1fea9089d6c9303e3020f5b56d4bf2f3b1ef
2018-05-31 11:25:57 -07:00
KongQun Yang
1b70c6772a Fix MPD@duration not set with MpdGenerator
Fixes: #401.

Change-Id: I5cd7c691d9cf4f187d12e5de60bf641e753f800c
2018-05-30 13:19:45 -07:00
KongQun Yang
fe944f0656 Update MpdGenerator to allow inject version for testing
- Add command line flag --test_packager_version to inject packager
  version; packager_main.cc is also updated to use the same flag.
- Also add a MpdGenerator test in packager_test.py.

Change-Id: I9a11a0ee5502ba30a8acc4d44ebbfaabbe0f2f6e
2018-05-30 13:16:33 -07:00
KongQun Yang
951fedaf41 Make docs/udpate_docs.sh executable
Including a misc clean-up in the script.

Change-Id: I7bda3ac52e15712356cc286caba08e1fd9db68e1
2018-05-25 20:43:43 +00:00
KongQun Yang
192ef2a0ac Update MuxerListeners to support multiple OnMediaStart/End
This is needed to support one file per representation per period where
there will be multiple content files generated.

Issue: #384

Change-Id: Ib7af750edf864d99075b8da4f3640217a5a94302
2018-05-25 20:43:34 +00:00
Aaron Vaage
cf3fc61fbe Fix incorrect data_reference_index in TextSampleEntry
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
2018-05-25 19:33:54 +00:00
Aaron Vaage
d7dcf9c7c7 Run Clang Format on Box Definitions
Change-Id: Ibfbfe025e7b914ddfa2f7c81d419d7b4f9212554
2018-05-25 19:33:45 +00:00
Aaron Vaage
388d49cf98 Rename webvtt_output_handler files
Renamed all the files called "webvtt_output_handler*" to
"webvtt_text_output_handler*" to better reflect the class name
in them.

Change-Id: I977bab362076974a124f263bcefff716ed8b6a0f
2018-05-25 18:56:54 +00:00
Aaron Vaage
b69eb49f77 Add Missing ASSERT_OK Calls in Cue Alignment Tests
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
2018-05-24 22:14:07 +00:00
Aaron Vaage
b01de0bfb6 Disallow Copy and Assign WebVtt File Buffer
We should never need to copy or assign the webvtt file buffer
so this change enforces that.

Change-Id: I119865e96c0188781adbe115beb2486b1b56542a
2018-05-24 21:47:56 +00:00
Aaron Vaage
d56efd147a Disallow Copy and Assign For WebVTT Output
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
2018-05-24 14:46:23 -07:00
Aaron Vaage
b3c148607f Simplify WebVtt Output
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
2018-05-24 18:09:48 +00:00
KongQun Yang
1a52a9b7c0 Fix potential incorrect target duration in iFrame Playlist
This may happen if media segments do not start with iframes.

Change-Id: Ie7b2d33a14405a5dcd071644f2fa3d5f9656dd07
2018-05-23 10:33:48 -07:00
KongQun Yang
cf40accaa8 [HLS] Fixing AdCues handling in iframe playlists
Previously for the last iframe in a segment, we wait for the next
segment to arrive before writing the EXTINF tag. If an Ad Cue comes
in before the next segment, the EXT-X-PLACEMENT_OPPORTUNITY tag would
be inserted before the iframe in previous segment.

Fixes #378, #396.

Change-Id: I1ede72a4d4edca94781c7b05bc25397d67916d1a
2018-05-22 16:02:28 -07:00
KongQun Yang
14caaf1e1c Update CHANGLOG for v2.1.0
Change-Id: Iac9e425b8eb9e8eac28d38ea69431298d026ada3
2018-05-22 19:53:03 +00:00
KongQun Yang
4d8ce0ff5d Extract bitrates in ES descriptor for AAC if available
Change-Id: I1aa53b519e8751400bea6b33936cb2e7a05958dc
2018-05-22 11:59:58 -07:00
KongQun Yang
734b4161f8 Ignore unsupported audio codec in the source content
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
2018-05-22 18:35:34 +00:00
KongQun Yang
317425d92f Fix TS mimetype in DASH
Change-Id: I64235d02206bda9a7c18d396b2889bb28091ab5d
2018-05-21 20:31:40 +00:00
KongQun Yang
b58753278c Add end to end tests for packed audio
Issue: #342.

Change-Id: Iaa890450615573da84b8934b2ba3ee3602d6fb74
2018-05-21 20:30:26 +00:00
Aaron Vaage
5bb5a58b7f Removed Unused Cue class
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
2018-05-21 18:46:57 +00:00
KongQun Yang
dd68b3e386 Update HLS examples to use elementary audio with TS output
Issue: #342.

Change-Id: Idd173c76d67d20d9c88be5ef2d6bfc1ce85b5523
2018-05-18 20:35:43 +00:00
KongQun Yang
8fc17c3653 Remove 'Package' from py.test names
Change-Id: Ifd4400c797eee3573fe732e017e2a05354d35a29
2018-05-18 20:34:18 +00:00
KongQun Yang
59941a101a Support entitlement license with Widevine key server
- 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
2018-05-17 21:03:05 +00:00
KongQun Yang
7f7843d241 Clean up output format determination
Requiring output format determined from 'output' to be consistent with
output format determined from 'segment_template'.

Change-Id: I32cbd63fcd6e2a4272dd0db531c1d5b385315445
2018-05-17 17:33:47 +00:00
Aaron Vaage
df6661b93d Fixed Incorrect BOM used in WEBVTT Header
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
2018-05-17 17:33:31 +00:00
KongQun Yang
0af2c5cdcf Integrate PackedAudioWriter
Closes #342.

Change-Id: I2fb4a651ad90448ab226b386c92c94e11ff9f9a8
2018-05-16 18:12:42 -07:00
KongQun Yang
39beb99d6c Implemented PackedAudioWriter
Issue #342.

Change-Id: Ic1379b00e38f818460f24ad57122ca22c5b5285a
2018-05-16 21:52:18 +00:00
KongQun Yang
33c4f344e7 Implemented PackedAudioSegmenter
Per HLS specification:
https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-3.4

Issue #342.

Change-Id: Iba7fae7a9b8912bcd13ae55d25b22a5803f7f7ea
2018-05-16 21:52:11 +00:00
KongQun Yang
5965b3e136 Move TS encrypted audio setup for HLS to hls_audio_util
Change-Id: Ibbc1fe2a8013abded6df2f2f57701ec328d3e5c6
2018-05-16 01:04:14 +00:00
KongQun Yang
8333908df1 Implemented Id3Tag class to handle ID3 tag
Also switched the original code in mp4 to use the new Id3Tag class.

Change-Id: I1db2c6c6142ed98b72a432980a6a54815f1a8cc4
2018-05-16 01:04:02 +00:00
Aaron Vaage
8f3a45c497 Respect Output Format In Packager Test
Make sure to use the output format when given when setting up our
tests. Not doing so results in text always being set to "vtt" when
the output format is "mp4".

Change-Id: I11c5f861091598a67fc76dc19b1b16a9a773a2e0
2018-05-15 23:35:54 +00:00
Aaron Vaage
2e9c2fe024 Fix Cue Insertion at Text Stream End
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
2018-05-15 22:01:09 +00:00
Aaron Vaage
d3fd4e9c05 Create Test For Ad Cues
Create an end-to-end test for ad cues. This test's final result is not
correct but illustrates the problem we have in the cue insertion and will
be fixed by a later CL.

Change-Id: Ia8b43a53848941be52cf9ade018668e6477e8df2
2018-05-15 21:55:40 +00:00
KongQun Yang
ae82cd16f3 Remove the usage of JsonWriter in WidevineKeySource
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
2018-05-15 20:10:43 +00:00
KongQun Yang
b209aeeb7a Remove the usage of JsonWriter in SimpleHlsNotifier
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
2018-05-15 20:06:54 +00:00
KongQun Yang
bbd5e074ee Add a test outputing DASH and HLS at the same time
Change-Id: I38c0ca9ed206536a4fd84e8c9c074609250013cc
2018-05-14 23:55:30 +00:00
Aaron Vaage
f619affb8f Store More Than One Cue
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
2018-05-14 22:10:07 +00:00