shaka-packager/packager
KongQun Yang 40ea1286b9 Add support for EditLists in ISO-BMFF
- EditLists in input files are parsed and applied to sample timestamps.
- An EditList will be inserted in the ISO-BMFF output if
  - There is an offset between the initial presentation timestamp (pts)
    and decoding timestamp (dts). Chrome, as of M67, still uses dts in
    buffered range API [1], which creates various problems when buffered
    range by pts does not align with buffered range by dts. There is
    another bug in Chrome that applies EditList to pts only [2]. This
    means that we can insert an EditList to align pts range and dts range.
  - MediaSamples have negative timestamps (e.g. for Audio Priming).

You may notice the below change on some contents:
- Some media duration is reduced by one or two frames. This is because
  EditList in the input file was ignored in the previous code, so video
  streams start with a zero dts and a non-zero pts; the smaller of dts
  and pts was used as the starting timestamp (related to the earlier
  workaround for Chrome's dts bug), so the calculated duration was
  actually a bit larger than the actual duration. Now with EditList
  applied, the initial pts is reduced to zero, so the media duration is
  also reduced to reflect the actual and correct media duration.

It may also result in negative timestamps in TS/HLS Packed Audio, which
will be addressed in a follow up CL.

Fixes #112.
Partially address b/110782437.

[1] https://crbug.com/718641, fixed but behind MseBufferByPts.
[2] https://crbug.com/354518. Chrome is planning to enable the fix for
    [1] before addressing this bug, so we are safe.

Change-Id: I59317740ad3807ca66fa74b3a18fdf7f32c96aeb
2018-07-26 23:20:21 +00:00
..
app Add support for EditLists in ISO-BMFF 2018-07-26 23:20:21 +00:00
buildtools/third_party Update DEPS to fix mac build failure 2016-08-19 13:49:41 -07:00
file Removing dependence on base file atomicops.h 2018-07-23 22:19:29 +00:00
hls Removing dependence on base file atomic_sequence_num.h 2018-07-24 21:22:50 +00:00
media Add support for EditLists in ISO-BMFF 2018-07-26 23:20:21 +00:00
mpd Removing dependence on base file atomic_sequence_num.h 2018-07-24 21:22:50 +00:00
testing Add docker files for testing on various linux distros 2017-12-12 22:51:05 +00:00
third_party Sync protobuf to v3.3.0 2018-05-10 23:07:59 +00:00
tools Allow clang-format in presubmit to be disabled 2018-05-08 23:59:52 +00:00
version Address gcc build failures in some platforms 2017-12-07 11:45:26 -08:00
common.gypi Suppress C4819 in Windows 2018-07-12 17:10:39 +00:00
packager.cc Return an error with '$' in stream output for WebVTT 2018-07-24 18:45:44 +00:00
packager.gyp Remove Old Cue Insertion Code 2018-06-21 18:47:04 +00:00
packager.h Support 'iframe_playlist_name' stream descriptor 2018-02-02 22:00:18 +00:00
packager_test.cc Add support for callback file 2017-09-07 19:26:26 +00:00
protoc.gypi Support generation of libpackager.so (shared_library) 2017-06-13 20:42:32 +00:00
status.cc Cleans up Status class 2018-01-31 03:32:07 +00:00
status.h Cleans up Status class 2018-01-31 03:32:07 +00:00
status_macros.h Generate full segment after cue point 2018-03-27 19:14:26 +00:00
status_test_util.h Implement multi DRM support. (Part 1) 2018-03-03 01:39:16 +00:00
status_unittest.cc Cleans up Status class 2018-01-31 03:32:07 +00:00