shaka-packager/packager/media/formats/mp4
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
..
box.cc Set Box Definition Defaults in Header 2018-06-04 23:14:59 +00:00
box.h Set Box Definition Defaults in Header 2018-06-04 23:14:59 +00:00
box_buffer.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
box_definitions.cc Set Box Definition Defaults in Header 2018-06-04 23:14:59 +00:00
box_definitions.h Set Box Definition Defaults in Header 2018-06-04 23:14:59 +00:00
box_definitions_comparison.h Implemented Id3Tag class to handle ID3 tag 2018-05-16 01:04:02 +00:00
box_definitions_unittest.cc Ignore unsupported audio codec in the source content 2018-05-22 18:35:34 +00:00
box_reader.cc Skip reading meta box as it may not be well formed 2018-03-01 20:21:37 +00:00
box_reader.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
box_reader_unittest.cc Fix x64 build on Windows. 2017-01-05 14:19:35 -08:00
chunk_info_iterator.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
chunk_info_iterator.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
chunk_info_iterator_unittest.cc Replace scoped_ptr with std::unique_ptr 2016-08-18 17:12:36 -07:00
composition_offset_iterator.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
composition_offset_iterator.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
composition_offset_iterator_unittest.cc Replace scoped_ptr with std::unique_ptr 2016-08-18 17:12:36 -07:00
decoding_time_iterator.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
decoding_time_iterator.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
decoding_time_iterator_unittest.cc Replace scoped_ptr with std::unique_ptr 2016-08-18 17:12:36 -07:00
fragmenter.cc Add support for EditLists in ISO-BMFF 2018-07-26 23:20:21 +00:00
fragmenter.h Add support for EditLists in ISO-BMFF 2018-07-26 23:20:21 +00:00
key_frame_info.h Support KeyFrame events in TS and MP4 2018-02-02 14:05:50 -08:00
mp4.gyp Support KeyFrame events in TS and MP4 2018-02-02 14:05:50 -08:00
mp4_media_parser.cc Extract bitrates in ES descriptor for AAC if available 2018-05-22 11:59:58 -07:00
mp4_media_parser.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
mp4_media_parser_unittest.cc Handle additional unused 'mdat' properly 2017-12-01 00:28:30 +00:00
mp4_muxer.cc Add support for EditLists in ISO-BMFF 2018-07-26 23:20:21 +00:00
mp4_muxer.h Add support for EditLists in ISO-BMFF 2018-07-26 23:20:21 +00:00
multi_segment_segmenter.cc Drepcate --num_subsegments_per_sidx 2018-07-02 21:59:14 +00:00
multi_segment_segmenter.h Drepcate --num_subsegments_per_sidx 2018-07-02 21:59:14 +00:00
segmenter.cc Add support for EditLists in ISO-BMFF 2018-07-26 23:20:21 +00:00
segmenter.h Support KeyFrame events in TS and MP4 2018-02-02 14:05:50 -08:00
single_segment_segmenter.cc Do not force earliest_presentation_time to 0 for VOD 2018-04-09 18:39:15 +00:00
single_segment_segmenter.h Drepcate --num_subsegments_per_sidx 2018-07-02 21:59:14 +00:00
sync_sample_iterator.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
sync_sample_iterator.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
sync_sample_iterator_unittest.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
track_run_iterator.cc Add support for EditLists in ISO-BMFF 2018-07-26 23:20:21 +00:00
track_run_iterator.h Add support for EditLists in ISO-BMFF 2018-07-26 23:20:21 +00:00
track_run_iterator_unittest.cc Address gcc build failures in some platforms 2017-12-07 11:45:26 -08:00