Commit Graph

955 Commits

Author SHA1 Message Date
KongQun Yang ef93a1ddaf CHANGELOG for v2.0.3
Change-Id: I7882d3ccab5e11e5c1be99c41917e9fabdd78b74
2018-04-23 16:02:45 -07:00
KongQun Yang b31fc75eb6 Use max bitrate in Representation@bandwidth instead of average bitrate
According to 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.

This suggests that max bitrate should be used instead of average
bitrate.

Also cleaned up BandwidthEstimator code.

Fixes #376.

Change-Id: Ibf5896394c5c6bb820849771a2129c59202d2273
2018-04-20 14:26:52 -07:00
KongQun Yang 9403f2f927 Set Widevine key request content-type to JSON
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
2018-04-20 14:21:04 -07:00
KongQun Yang 32398da5c4 Fix default_language not effective with 2-char code
Two-character ISO-639 code in --default_language was ignored due to
a bug in language code matching as the language code in stream is
always converted to 3-character code.

Fixes #371.

Change-Id: I8618938af583a417446636ff9efe1c72ce822c33
2018-04-20 14:18:13 -07:00
KongQun Yang a6352d4b11 Remove pto_adjustment flag
This flag was introduced to workaround a rounding error in Chrome
(probably in other browsers too).

Also although this flag avoids the first frame of a Period to be
dropped due to rounding error but it could cause the last frame of a
Period to be dropped.

Now that we use a high precision Period@duration, we do not expect to
see rounding errors any more. The player would be a better place for
the workaround even if it is still needed.

Related issue: #368.

Change-Id: I3bd517ecc6d548ff62e0c13394edb49d4bc68e8f
2018-04-20 14:01:14 -07:00
KongQun Yang 9716ef73a0 Collect and generate license notice
Under flag --licenses

Bug: 74447460

Change-Id: If99c4e927431ce08158e3734428e3b4d23d62c75
2018-04-20 13:58:49 -07:00
KongQun Yang 1223694249 Do not force earliest_presentation_time to 0 for VOD
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
2018-04-20 13:58:01 -07:00
KongQun Yang 668335c647 Generate a more accurate time in Period@duration
Chrome internally uses time accurate to microseconds, which is
implemented per MSE spec (https://www.w3.org/TR/media-source/).

Generate Period@duration with better precision to avoid possible
buffered range gaps in Chrome (possibly other browsers too), which
may lead to other problems like playback stall.

b/74238961
Fixes #368.

Change-Id: I357a0f62b67f75c7ca044bb99ea4e3c8bbb6fecd
2018-04-20 13:39:40 -07:00
KongQun Yang 16fddbe1c3 CHANGELOG for v2.0.2
Change-Id: I4351f68f4b689ee1542791398122a2885807f965
2018-03-27 17:34:00 -07:00
KongQun Yang 265fa9ba90 Allow SyncPointQueue to be cancelled
Change-Id: Idbf6ee7a5d9721681811189fca4190e7a0286c83
2018-03-27 16:55:53 -07:00
KongQun Yang a42200cfaf Generate full segment after cue point
Also added RETURN_IF_ERROR status macro.

Change-Id: I04643b6252ea5623128f9a16fa744a255c91be17
2018-03-27 16:54:48 -07:00
KongQun Yang e1bb27f130 Integrate CueAlignmentHandler
Also changed ChunkingHandler to be one-one handler.

Issue: #355

Change-Id: Ie98a96bcc0ddded347699c9f333f604826976d11
2018-03-27 16:48:08 -07:00
Aaron Vaage e685c8a63a Implements SyncPointQueue and CueAlignmentHandler
SyncPointQueue manages all cue points and returns aligned cue
points to the callers (CueAlignmentHandlers).

CueAlignmentHandler is responsible for aligning cues from different
streams. It uses SyncPointQueue internally to align / synchronize the
cue points.

Issue: #355

Change-Id: I281fecb46a3ca7172d71e7495bdd07b8efdeb283
2018-03-27 16:25:11 -07:00
Aaron Vaage 229bd779fd Change Scte35 to use double for time
Change-Id: I2588d3c86d48dc2d9f3692aa0aab28b9de63d109
2018-03-27 16:24:58 -07:00
Aaron Vaage d04f0ef00f Change CueEvent to use time in seconds
Change-Id: I03527db76905f25f0a142940f5fcf73e2a92d42f
2018-03-27 16:24:50 -07:00
Aaron Vaage f2f88c159e Isolated OnMediaSample in Chunker
Change-Id: I3af45543a1da1d1cf0b0741dd732dc71b2c30abe
2018-03-27 16:23:59 -07:00
Aaron Vaage f125a4e91a Isolate OnScte35Event in ChunkerHandler
Change-Id: I9b34f959c22df498a338eb49c87b67003617ead2
2018-03-27 16:23:49 -07:00
Aaron Vaage 71c589b5fb Isolate OnStreamInfo in Chunking Handler
Change-Id: If35b9f545f96237095177438a5f95f964cbbfe3d
2018-03-27 16:23:38 -07:00
KongQun Yang 113bff76c1 CHANGELOG for v2.0.1
Change-Id: I7e509f4a8b23b956d76cc93907361bd737995737
2018-03-05 17:51:23 -08:00
KongQun Yang db418ab14e Rewrite init segment in MultiSegmentSegmenter::DoFinalize
This is called when reaching end of the file of the media. The duration
of the media is updated.

Fixes #340.

Change-Id: I446f2d341b02125d4a7d8c958bda269b5403cb9c
2018-03-05 17:50:12 -08:00
KongQun Yang 79b3d184d3 Recognize m4s as a valid extension for mp4
Closes #331.

Change-Id: Ic4aaa02245b31a0aa4fdfe08212fa3b242cd9262
2018-03-02 17:29:09 -08:00
Aaron Vaage 650f59f8a0 WebVtt Ignore Zero Duration Cues
We have an assert that ensures that the end time is greater than
the start time for any cue. However we never checked that cues
had a non-zero duration when parsing them.

We will throw away cues with a duration of zero (and print a
warning message) as they are not spec compliant.

Closes: #335
Change-Id: I404e8f3a5a8d43eff75a2554db3e38e8d340f421
2018-03-01 22:26:34 -08:00
KongQun Yang 9476e826d5 Skip reading meta box as it may not be well formed
In the video captured by Android's default camera app, meta box is written as
as Box instead of FullBox specified in the spec.

Closes #319.

Change-Id: I526492fdd505d5929c5161cb1ed1503b724de7e9
2018-03-01 22:26:16 -08:00
KongQun Yang f8a1cb66ad Calculate presentationTimeOffset and Period@duration from segments
Prefer timestamps from Video AdaptationSets if available - this avoids
possible video playback jitters due to gaps.

presentationTimeOffset is not applied to the first period as it may in
negative dts which Chrome does not like: https://crbug.com/398141.

It is safe to apply to subsequent periods as the actual offset applied
takes Period@start into consideration:

    offset = Period@start - presentationTimeOffset

The result timestamp with offset applied is close to Period@start, so
it is unlikely to result in a negative dts value.

Closes b/73899306.

Change-Id: If8361f5469610093b3aac6675754536ad7e83c4c
2018-03-01 22:25:55 -08:00
KongQun Yang 1d6a2de5ab Update the date in CHANGELOG
Change-Id: Ifd39435013e296f71e8b48ca9ac1869324f8cd0d
2018-02-10 23:30:18 +00:00
KongQun Yang 4bf5bfb204 CHANGELOG for v2.0.0
Change-Id: Ia72f9f427aed40bbe05249668c86dc9944e37adf
2018-02-10 23:17:47 +00:00
KongQun Yang 594d1f0de4 Copy over parameter sets in the sample if different to sample entry
When converting from NAL unit stream to byte stream.

The packager should not assume the parameter sets in the sample is the
same as the parameter sets in sample entry (decoder configuration).

Fixes #327.

Change-Id: I7e84d28a296f4b33db0523cca5eabd62f623e852
2018-02-09 15:43:00 -08:00
KongQun Yang 11cbbd86fb Fix fMP4 'cbcs' playback issue in Safari
Looks like Safari does not like v0 tenc box.

- Use v1 tenc box for cbcs and cens protection_scheme as required by
  CENCv3 spec.
- Set crypt_byte_block and skip_byte_block to 0 for full sample
  encryption cbcs and cens.

Fixes #326

Change-Id: I5581cd856fffc4ff104d950f3ca19b9337d57a78
2018-02-08 23:40:46 -08:00
KongQun Yang aa4bb49b2f Fix language option not honored on text streams
Change-Id: I9034b779e9b193c39201a5f2d142ec390927e5f7
2018-02-08 03:48:46 +00:00
KongQun Yang 0401d62a3f Update documentation on Widevine DRM with more examples
Change-Id: I5230e8b138c4abda44c2fb54bc2f8b2d7d3e3b85
2018-02-08 02:35:53 +00:00
KongQun Yang 3606f313d6 Updated documentation with webvtt and iframe playlist examples
Closes #205, #287

Change-Id: I77ca15f63e262eb0eaff7b6d74d259d30da9f823
2018-02-08 02:35:39 +00:00
KongQun Yang 7dcab4c799 Fix '--temp_dir' option does not work problem
Fixes #322

Change-Id: Ia0ea32029c81fd8ac5661f8002154e2a54d3a84d
2018-02-07 13:46:13 -08:00
Aaron Vaage a82edb5228 Make StreamDescriptor Object
Create a StreamDescriptor class that can be used to build the stream
descriptor command line argument.

Change-Id: Ifcba4f37d69a1a36c4add51a2a10c3f0c8b2ccd7
2018-02-07 19:22:05 +00:00
KongQun Yang 221ac81772 Prefer Period@duration for static MPD with >1 periods
It is easier to insert Ad Periods with Period@duration compared to
Period@start.

Change-Id: Ib52e81612562bf60b0e0513a09d9a31c42b09604
2018-02-07 01:13:28 +00:00
Aaron Vaage 48cb55c8d4 Correct WEBVTT Header In Sample Test Files
The old vtt sample data has the header as "WEBVTT FILE" which does
not reflect what the spec says it should be.

This changes it to "WEBVTT" as described in the WebVTT spec.

Change-Id: Ib54396a8b937501a835dafe966bf05b95b0b22c4
2018-02-07 00:07:16 +00:00
KongQun Yang 2d5e2b0903 Fix DCHECK of SimpleThread on invalid command line options
- Construct SimpleThreads only after all workers have been successfully
  initialized

b/72999680

Change-Id: I4016321a4bdd27b1de746c50c5f1d7a60d7ae9f1
2018-02-06 22:41:38 +00:00
Aaron Vaage c7eb2b4a7e Output Empty WebVTT Text Segments
Have the text webvtt pipeline output empty segments rather than skipping
them.

Bug: #324
Change-Id: I175cf22b65b241f6bf566aba2440518f3df95277
2018-02-06 13:32:42 -08:00
Aaron Vaage f35410deb1 Output Empty MP4 WebVtt Cues
When a gap is found in the text stream, the WebVtt to Mp4 converter will
now output the special empty vtt cue.

Change-Id: I8be88c6b7589aa120a2215e1e4b8e98031fe326d
Closes: #324
2018-02-06 16:45:04 +00:00
KongQun Yang 8257eea804 Bug fixes and clean-ups for I-Frame playlists
- Add empty lines between different types of renditions to improve
  readability.
- Group variants with the same audio/text group together, as it is
  where the Adaptation occurs.
- Write master playlist after writing media playlists. This makes
  more sense and it is also necessary to have the bandwidth of
  the last iframe playist segment correctly computed.
- For fMP4, I-Frame segment must include the 'moof' header.
- Fix a problem that hls_iframe_playlist_name is not passed to
  MuxerListenerFactory.

Issue: #287

Change-Id: Icf37c5de1dc29f85ae3f419cbc3264d04ca491a4
2018-02-05 17:36:28 -08:00
KongQun Yang 1750357024 Support EXT-X-I-FRAME-STREAM-INF in master playlist
Issue: #287

Change-Id: I07fdfa095fe1797b3aa091d48798a2b5fbb4dfbe
2018-02-06 01:11:25 +00:00
Aaron Vaage c991490e82 Prepare WebVTT To MP4 to handle gaps
Adding all the code needed to allow the webvtt to mp4 converter to
send empty vtt cues. This change does everything except writing the
mp4 box.

Bug: #324
Change-Id: I16188e6357632b2ed06f7e9bab7844f093266696
2018-02-06 00:55:32 +00:00
Aaron Vaage 9452a1bb1a Make Segments Their Own Struct
Instead of always tracking segments with an index, this change makes a struct
that will act as the segment and track which segments are in it. Each
segment will store all the samples in the order they were given, it will
avoid any sorting.

Closes: 72867775
Change-Id: Ic5829161510fe8f3320d960c3bc4a276c26ff3be
2018-02-06 00:55:00 +00:00
Aaron Vaage 80ed014cf8 Create Preserve Order Test
Create WebVtt test that shows that the current implementation of the
webvtt segmenter does not respect the input order of cues.

Bug: 72867775
Change-Id: I811b3a93c10650e0cf9290c9c0c1680f562deb30
2018-02-06 00:54:15 +00:00
KongQun Yang 04577b9638 Refactor MasterPlaylist::WriteMasterPlaylist
Change-Id: Ida7453761748087cd13aab640c400381696578e1
2018-02-02 14:13:12 -08:00
KongQun Yang b647c6731c Support KeyFrame events in TS and MP4
Issue: #287

Change-Id: I7c50853c7cc61c5fadbb620f44f7574a27dc2b68
2018-02-02 14:05:50 -08:00
KongQun Yang 570a2d1a15 Support 'iframe_playlist_name' stream descriptor
Issue: #287

Change-Id: I484761dfacadce05175d16c4c12454f0ed932579
2018-02-02 22:00:18 +00:00
Aaron Vaage e98a150d62 Added DEFAULT and AUTOSELECT for Text
Took the same logic for DEFAULT and AUTOSELECT used by audio and
applied it to text. Combined the build tag logic for audio and
text as they were the same expect for a couple fields.

Bug: #205
Change-Id: I75ecbf4b25cd559b826982d12a5b132e70b83b69
2018-02-02 11:07:38 -08:00
Aaron Vaage e2dae2d960 Add Subtitle Support to HLS Playlists
The master playlist and media playlist did not have implementations
for handling text streams. This change adds support for both.

Bug: #205

Change-Id: I1329b8cc2585f15b89959071db9dd16d35847cba
2018-02-02 18:33:13 +00:00
KongQun Yang 82735be58d Support key frame events in MuxerListener and HlsNotifier
Issue: #287

Change-Id: I33b91b73988fc40e113bd2e627d08f549a7e3dc5
2018-02-02 00:00:53 +00:00
Aaron Vaage 8104628f48 Use Tag in Media Playlist
Instead of formatting the tag manually in MediaPlaylist, use the tag
class from MasterPlaylist.

Change-Id: I4099169a80a6d8595ab7f49e21cac4e7e0614832
2018-02-01 22:59:45 +00:00