Note that TTML in ISO-BMFF is not supported yet.
Also updated packager_test.py:
- Added a test using TTML passthrough.
- Computed output extension from input extension unless output_format
is specified.
Fixes#478.
Change-Id: Ia917fc4ed3c326782791ed67601fba02ea28b11d
The time for the previous segment was used when generating the segment
name. This resulted in the first segment being overwritten and
mismatching manifest and media files. It led to playback problems.
Issue #472.
Change-Id: Ia8130ce261585e1a2ede83b26de3e32508de087f
The VP9 level is computed when the container is missing a codec config
or if the level is missing from the codec config.
This fixes VP9 in ISO-BMFF files generated by FFmpeg v4.0.2 or earlier
which does not have level set in the codec config.
Fixes#469.
Change-Id: I685bfd48be16ee6b2209da1c3173f7d6bb02b36a
Implemented per AV1 Codec ISO Media File Format Binding at
https://aomediacodec.github.io/av1-isobmff/
And AOM AV1 codec mapping in Matroska/WebM at
https://github.com/Matroska-Org/matroska-specification/blob/av1-mappin/codec/av1.md
Note that AV1 specific boxes are not supported in this CL, i.e.
AV1 Forward Key Frame sample group entry 'av1f', AV1 Multi-Frame
sample group entry 'av1m' etc are not supported. These boxes are optional.
We will add support later if they are useful to the clients / players.
Encryption is not supported yet.
Issue #453.
Change-Id: I630432d0a9bf82d263ffaf40e57f67fc65eee902
We used to skip all the remaining bytes if the size is less than
|crypt_byte_block| blocks.
This interpretation is incorrect. We should only leave the last partial
16-byte block un-encrypted.
Change-Id: I4f09600efa52e2fdf4d0b661dfc418dcb675f9f6
Renamed "FakeMediaHandler" to "CachingMediaHandler" so that it
is easier to differentiate from "FakeInputMediaHandler". It will
be used as the single method to verify media handler output.
This is part of an effort to find a cleaner way to test media handlers.
Change-Id: Ie391fe23ee3389d13b012ae3093744a453106c19
Negative duration is not allowed, so set the duration of that sample to
an arbitrary small value in case it is needed to decode future samples.
Issue #451.
Change-Id: I9250d71d163f769ea2657d56e108b6dbd583de67
Keep bundled binutil scripts but not downloading actual binaries by default.
Automatic downloading of binutils has been causing problems for some users:
see #164, #412, #440.
Using bundled binutils helps reduce linking time, but packager codebase is
relatively small, so the gain is not significant.
Local testing shows that the full build time increases from 1m42s to 1m50s, i.e.
an increase of about 8s, or ~8%.
User can still enable the usage of bundled binutils by running
'python src/packager/third_party/binutils/download.py' and set
'linux_use_bundled_binutils' and 'linux_use_bundled_gold' to 1 in GYP_DEFINES.
Change-Id: I7ecae2333861f41054f957d0a6081dae948167bd
Note that STYLE and REGION are not supported in mp4 container due to
spec limitation as 14496-30:2014 does not specify a way to signal
styles/regions inside mp4.
Closes#344.
Change-Id: I05c14df916f7b2c7ca4364ee9407e0eda4dc7a3f
- Also fixed compilations in Alpine Linux and other flavors of Linux.
- Added container versions in docker files to always use a verified
version.
Closes#164.
Change-Id: I949a8709e4d70c49129c9c2e8608dd78193d964c
Configurable under --enable_legacy_widevine_hls_signaling, off by
default.
When it is enabled, do not fail if provider or content_id are missing,
but log a warning instead.
Bug: 112268769.
Change-Id: I2531aa7474d2818700b90fa0679b49891bb935ef
--io_block_size determines the buffer size for each read/write in
ThreadedIO.
A big io_block_size does not help much as long as --io_cache_size
is big enough.
Instead, it may cause problems. For example, Linux pipes block until
reading io_block_size number of bytes, which causes a large delay
when reading audio streams.
Change-Id: I5bdd3d61388579c7e8647cdab3152135a40a752b
In some ISO-BMFF files, there is an initial non-zero composition offset,
but there is no EditList present.
This is against ISO-BMFF spec recommentation [1] and we believe in most
cases it is just missing the EditList.
[1] 14496-12:2015 8.6.6.1
It is recommended that such an edit be used to establish a presentation
time of 0 for the first presented sample, when composition offsets are
used.
Issue: #112.
Change-Id: I178d5ec9d8c294c9f70aac4f4dd6254c824e2255
Previously it is possible that the same file path is generated when
the function is called consecutively in the same thread.
The problem can be re-produced in Windows. Does not seem to be
re-producible in Linux and Mac.
Fixes#448, #449.
Change-Id: Ia0163492e3494eba00f56f4d356aa1010b9660cc
- Also make it explicit that MemoryFile does not support opening an
already open file. An error will be returned when trying to open an
already open file. Previously the code may crash with memory problems.
- Also updated packager_test to use different test directories for
different tests.
Fixes Appveyor crash due to memory corruption: #449.
Appveyor may still fail but will contain a meaningful error logging.
Change-Id: Ibc9346ef7f301e416a4a09f120bca56504c939d8
This also ensures that it does not violate std::sort() requirement on
strict ordering, which is enforced in gcc/g++ though not in clang.
std::sort() strict ordering requirement:
std::sort() need a comparator that return true iff the first argument is
strictly lower than the second one. That is: must return false when they
are equal.
Change-Id: I781cf4ed4125fcad212eba5430a264f3a3d71c16
This is recommended by Apple and other content providers:
https://apple.co/2uTTAc4
- Set default --clear_lead to 12 seconds, i.e. about 2 segments.
- Set default --fragment_duration to 0 so fragment (sub-segment) is not
generated by default.
Change-Id: Ie6ec3ab6f0ce973547989c663a92b637a2fdc47c
It is possible to see a negative timestamp if the input mp4 file
contains EditList.
Also increase the queue size for EncryptionKey to be able to handle
smaller crypto_period_duration during testing.
Change-Id: I68278bf482d6662e771d9b80f4d5409605065aac
Configurable with --transport_stream_offset_ms.
This is needed to compensate for possible negative timestamps in
inputs, which could happen on ISO-BMFF with EditLists.
Issue #112.
Change-Id: I0fce8766c9df2911b9bb859c1e54052a8ed2abfb
In some ISO-BMFF files, there is an initial non-zero composition offset,
but there is no EditList present.
This is against ISO-BMFF spec recommentation [1] and we believe in most
cases it is just missing the EditList.
[1] 14496-12:2015 8.6.6.1
It is recommended that such an edit be used to establish a presentation
time of 0 for the first presented sample, when composition offsets are
used.
Issue: #112.
Fixes: b/110782437.
Change-Id: I23d33810ce536b09a1e22a2644828d824c1314f5
- 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
DASH live profile with static MPD was incorrectly handled in the same
way as live profile with dynamic MPD, i.e. by assuming the synchronized
Representations, which is incorrect.
It can be easily re-produced in multiple period outputs, i.e. with Ad
cues. It may happen with regular contents as well, due to race
condition, though with a much lower chance of occurring.
Fixes#435.
Bug: 111359775.
Change-Id: I7de087f5dd8602b4c4e35cb697d589fa3699e8a5
They will result in empty DASH representations, which is not spec
compliant.
For text, if the cue is before the max end time, it will still be
dispatched as the text samples intercepted by the cue can be split into
two at the cue point.
Bug: 111359775.
Change-Id: I55c2025c4e9d64c88e6a685c0cf3024a0cc4a6d8
MPD cannot be validated right now since we do not generate deterministic
mpd with multiple inputs due to thread racing.
Exclude mpd comparison in this case.
Change-Id: I03b68b4969a39e20927c8a9b1475f72493682696