Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync #14

Merged
merged 62 commits into from
May 15, 2024
Merged

Sync #14

merged 62 commits into from
May 15, 2024

Conversation

kevleyski
Copy link
Owner

No description provided.

cosmin and others added 30 commits February 8, 2024 09:47
The current libwebm integration test samples contain `libwebm-0.2.1`
however we have updated to a newer version of libwebm so we need to
update the samples.

As of `libwebm-0.3.0` this signature has been frozen so we won't have to
do this again.
#1320)

As part of the CMake port we updated the duration formatting to contain
maximum of 6 decimal places but without trailing 0s. There was a bug
however where it used 6 significant digits rather than 6 decimal places
(`%g` rather than `%f`).

This fixes the bug and also updates the MPD sample files for the
integration tests to contain maximum of 6 decimal places.
The accidental tolower in `SplitAndTrimSkipEmpty` was causing stream
descriptors to not preserve case for certain things like
accessibilities.
The fix in #1289 was not complete and left the fake clock as null which
didn't have any effect. This was revealed by integration tests showing
mismatches in the timestamps in MP4.
The current mbedtls integration was not working for some modes. See for
example #1316 and also lots of failing integration tests.

For example in pattern encryptor it works on one block at a time so it
cannot assume it's going to always get a buffer with a padding for an
extra block.

From what I can tell when the padding mode is correctly set to
`MBEDTLS_PADDING_NONE` there is no extra block being written to or
required.

This passes all crypto unit tests and integration tests.

Closes #1316
A positive value, in milliseconds. It is the threshold used to determine
if we should assume that the text stream actually starts at time zero.
If the first sample comes before default_text_zero_bias_ms, then the
start will be padded as the stream is assumed to start at zero. If the
first sample comes after default_text_zero_bias_ms then the start of the
stream will not be padded as we cannot assume the start time of the
stream.
…369) (#1311)

Part of #369

This adds read support for some MPEG-TS PMT elementary stream
descriptors:
- ISO639 Language Descriptor providing language code and audio type
- Maximum Bitrate Descriptor providing peak stream bandwidth

Those metadata are propagated to StreamInfo structures:
- StreamInfo.language field
- AudioStreamMetadata.max_bitrate field for audio streams
- audio type is currently not propagated - corresponding field has to be
added to AudioStreamMetadata

Test vector file containing those descriptors is provided.
protobuf depends on absl, so both needed an update.

Updating absl fixes issues on Alpine 3.19 (see PR #1327), and also
removes the need for hacks around vlog flags.
The issues we had with zlib and CMake have been resolved upstream.
This will force the muxer to order streams in the order given on the
command-line.

Closes #560
Closes #1280
Closes #1313

---------

Co-authored-by: Joey Parrish <[email protected]>
Co-authored-by: Cosmin Stejerean <[email protected]>
Add ability to set `Label` tag in MPD, see page 35 of DASH-IF IOP 4.3
https://dashif.org/docs/DASH-IF-IOP-v4.3.pdf

Implements #881 

---------

Co-authored-by: Cosmin Stejerean <[email protected]>
According to a comment in
packager/third_party/abseil-cpp/source/absl/log/CMakeLists.txt, many
linkers will strip the contents of absl::log_flags because its symbols
symbols are only used in a global constructor, and that for now, clients
should link using
$<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags>.

Closes #1325
Closes #988

---------

Co-authored-by: Cosmin Stejerean <[email protected]>
…ly (#975)

ISO/IEC 14496-15 says about the `HEVCDecoderConfigurationRecord`:

> **array_completeness** when equal to 1 indicates that all NAL units of
> the given type are in the following array and none are in the stream; 
> when equal to 0 indicates that additional NAL units of the indicated type 
> may be in the stream; the default and permitted values are constrained 
> by the sample entry name;

This PR sets `array_completeness` to 0 if parameter NAL units may appear
in the stream when they are not stripped by
`--strip_parameter_set_nalus`.

This should increase player-compatibiltity for streams with mid-stream
SAR changes.

---------

Co-authored-by: Cosmin Stejerean <[email protected]>
…#1303)

feat: Added audio specific configuration udts box to AudioSampleEntry
for MP4 input/output. DASH tags for DTS audio as specified in ETSI TS
103 491 and ETSI TS 102 114.

Closes #1301

---------

Co-authored-by: Cosmin Stejerean <[email protected]>
adds an optional `--hls_start_time_offset` parameter, that, when
used, adds `EXT-X-START` tags to the HLS media playlists.

The EXT-X-START tag allows to specify the location where the player
starts playing, either from start (positive value) or from end (negative
value).
This is especially useful in case of livestreams where this tag can be
used to set the target latency of the playback.

Reference: https://datatracker.ietf.org/doc/html/rfc8216#section-4.3.5.2

The RFC says, that the `EXT-X-START` tag could also be added to the
master playlist, but my tests have shown that most players only respect
it when it's in the media playlists.

Fixes #970

---------

Co-authored-by: Joey Parrish <[email protected]>
In some cases it can happen that the http server responds with a
non-successful status code without reading the response body. In this
case curl may decide not to read from the cache since there is really no
point in sending data to the server. In case some other thread of shaka
has already called HttpFile::Flush it may end up deadlocked there
waiting for the cache to either close or become empty. Thus, we close
the cache when leaving the main thread as no data will be read by curl
after it has finished anyways.

Closes #1347
This is based on comments at
#891. The muxer is deciding
whether to write to a single file or a segment file based on the
configuration.

Example:
```
../packager 'in=TOS.ts,stream=video,output=tos_video.ts,playlist_name=tos_video.m3u8' \
            'in=TOS.ts,stream=audio,output=tos_audio.ts,playlist_name=tos_audio.m3u8' \
           --hls_master_playlist_output tos.m3u8
```
Tested the content using Exoplayer.

---------

Co-authored-by: Cosmin Stejerean <[email protected]>
Replaces #1181

* Add support for EBU Teletext input following Level 1.5 of the core
specification ETSI EN 300 706 V1.2.1 (2003-04).
* Add support for webvtt in MP4 segments output.

Closes #272

---------

Co-authored-by: Marcus Spangenberg <[email protected]>
Add startwithSAP/subsegmentstartswithSAP for aac, ac3, ec3 and ac4 audio tracks according to LIVE or VOD profile.

Replaces #1055
Partial solution for #364

---------

Co-authored-by: Xingzhao Yun <[email protected]>
Co-authored-by: Joey Parrish <[email protected]>
An updated version of PR #1027

That previous PR was done using 2021 code, and there were many changes
in the codebase from there, so a rebase was needed and also some minor
tweak here and there. But it's the same code, just reimplemented on a
newer codebase.

If you want to take a look at this in action, after building shaka
packager with this PR's code included, try this commands in 3 different
simultaneous bash sessions:

1. Video UDP input: `ffmpeg -f lavfi -re -i
"testsrc=s=320x240:r=30,format=yuv420p" -c:v h264 -sc_threshold 0 -g 30
-keyint_min 30 -r 30 -a53cc 1 -b:v 150k -preset ultrafast -r 30 -f
mpegts "udp://127.0.0.1:10000?pkt_size=1316"`
2. WebVTT UDP input: `for sec in $(seq 0 9999) ; do printf
"%02d:%02d.000 --> %02d:%02d.000\ntest second ${sec}\n\n" "$(( ${sec} /
60 ))" "$(( ${sec} % 60 ))" "$(( (${sec} + 1) / 60 ))" "$(( (${sec} + 1)
% 60 ))" ; sleep 1 ; done > /dev/udp/127.0.0.1/12345`
3. shaka packager command line: `timeout 60
path/to/build/packager/packager
'in=udp://127.0.0.1:10000?timeout=8000000,stream_selector=0,init_segment=240_init.m4s,segment_template=240_$Number%09d$.m4s,bandwidth=150000'
'in=udp://127.0.0.1:12345?timeout=8000000,stream_selector=0,input_format=webvtt,format=webvtt+mp4,init_segment=text_init.m4s,segment_template=text_$Number%09d$.m4s,language=eng,dash_roles=subtitle'
--mpd_output ./manifest.mpd --segment_duration 3.2
--suggested_presentation_delay 3.2 --min_buffer_time 3.2
--minimum_update_period 3.2 --time_shift_buffer_depth 60
--preserved_segments_outside_live_window 1 --default_language=eng
--dump_stream_info 2>&1`

Note the added `input_format=webvtt` to the shaka packager command's
second selector. That's new from this PR. If you don't use that, shaka's
format autodetection will not detect the webvtt format from the input,
as explained in
#685 (comment).
Try the command without it if you want to.

Fixes #685
Fixes #1017

---------

Co-authored-by: Daniel Cantarín <[email protected]>
This tweaks the default config for stderrthreshold from absl/log so that
we always get logs to stderr by default, as we did in v2. The --quiet
and --v flags that existed in v2 can still be used to modify the log
level, as well as the new --minloglevel from absl/log.

Issue #1325
Without this, the command prompt will not appear on its own line after
running `packager` with no arguments.
cosmin and others added 29 commits February 28, 2024 15:45
Fixes #1356 which was caused by the fix in #1281 which updated this to
use the correct FairPlay system ID. However since old versions
recognized the previous system ID this restores support for it to avoid
breaking clients.
…rst sample durations (#838)

Use the second sample in mp4 and webm formats. #835 had issues with
merging due to golden file conflicts. Because we cannot make dependent
pull requests, this is a replica of #835.

---------

Signed-off-by: Cosmin Stejerean <[email protected]>
Co-authored-by: Cosmin Stejerean <[email protected]>
## [3.0.0](v2.6.1...v3.0.0) (2024-02-28)

### ⚠ BREAKING CHANGES

* Update all dependencies
* Drop Python 2 support in all scripts
* Replace glog with absl::log, tweak log output and flags
* Replace gyp build system with CMake

### Features & Bug Fixes

Too many to list... See CHANGELOG.md for a full accounting!

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
The build invocation from the release workflow needs settings to trigger
self-hosted builds, including Linux arm64.
Support for this came out in January, 2024. Explicit macos versions seem
to be necessary for now, until GitHub offers "latest" labels targeting
specific architectures.
This silences warnings about outdated node runtimes in CI jobs.

 - Trivial upgrades:
   - actions/checkout@v3 => v4
   - actions/deploy-pages@v2 => v4
   - actions/upload-pages-artifact@v2 => v3
   - mxschmitt/[email protected] => v3.17
   - mikepenz/[email protected] => v4
 - Upgrades that required small changes or deeper testing:
   - actions/download-artifact@v3 => v4
   - actions/upload-artifact@v3 => v4
   - google-github-actions/release-please-action@v3 => v4
 - Replaced:
   - svenstaro/upload-release-action@v2 => gh CLI

See also:
- https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md
🤖 I have created a release *beep* *boop*
---


##
[3.0.2](v3.0.1...v3.0.2)
(2024-03-07)


### Bug Fixes

* duplicate representation id for TTML when forced ordering is on
([#1364](#1364))
([0fd815a](0fd815a)),
closes
[#1362](#1362)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
The release workflows did not run checkout with `fetch-tags: true`, so
the builds were unable to compute the correct release version number. I
audited all instances of `actions/checkout` to add `fetch-tags` where
needed and clean up unneeded options.

I also had to fix options to `docker/build-push-action`, which by
default ignores `actions/checkout` and tries to pull from git itself.
This led to the Docker build running in a context without the new tag.

Finally, to make verification easier and provide version info in the
build logs, this adds debugging info to the version-generation script
via stderr.

Closes #1366
The default .npmignore would disallow bin/, which contains binaries for
our NPM release. Every release before v3.0.3 was missing .npmignore, and
therefore had no binaries. These were unusable in NPM, and have been
marked as deprecated because of it.

Closes #1369
The check for `!mpd_dir.empty()` is not needed because MakePathRelative
handles the case where the parent path is empty. As a result of this
check the base url, segment url, or segment template URLs were all
missing in cases where the mpd output was in the current working
directory.

Fixes #1378
🤖 I have created a release *beep* *boop*
---


## [3.0.4](v3.0.3...v3.0.4) (2024-03-27)


### Bug Fixes

* BaseURL missing when MPD base path is empty ([#1380](#1380)) ([90c3c3f](90c3c3f)), closes [#1378](#1378)
* Fix NPM binary selection on ARM Macs ([#1376](#1376)) ([733af91](733af91)), closes [#1375](#1375)

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
They can still be skipped by passing `-DSKIP_INTEGRATION_TESTS=ON` for
the build configuration. Fix integration tests so they run correctly when building out of tree.

Use FindPython3 in CMake to fix build and integration tests on Windows.
This PR adds parsing of teletext styling, and rendering of the styling
in output TTML and WebVTT subtitle tracks.

Beyond unit tests, I've used the sample
https://drive.google.com/file/d/19ZYsoeUfH85gEilQkaAdLbPhC4CxhDEh/view?usp=sharing
which has rather advanced subtitling with two separate rows at the same
time, where one is left aligned and another is right aligned. This
necessitates two parallel cues to be rendered. It also has some colored
text.

Solve #1335.

## parse teletext styling and formatting

Extend the teletext parser to parse the teletext styling and formatting.
This includes translating rows into regions, calculating alignment
from start and stop position of the text, and extracting text and
background colors.

The colors are limited to full lines.
Both lines and regions are propagated in the TextSample structures.
This is because the number of lines may differ from different sources.
For teletext, there are 24 rows, but they are essentially always
used with double height, so the number of output lines is 12
from 0 to 11.
There are also corresponding regions are denoted "ttx_R",
where R is an integer row number. A renderer can use either
the line number or the region ID to render the text.

## ttml generation for teletext to EBU-TT-D

Add support to render teletext input in EBU-TT-D (IMSC-1) format.
This includes appropriate regions ttx_0 to ttx_11 signalled
in the TextSamples, alignment and text and background colors.

The general TTML output has been changed to always include
metadata, layout, and styling nodes, even if they are empty.

EBU-TT-D is detected by the presence of "ttx_?" regions in the
samples. If detected, extra TTML elements will be added and
the EBU-TT-D linePadding used as well.

Appropriate styles for background and text colors are generated
depending on the color and backgroundColor attributes in the
text fragments.

## adapt WebVTT output to teletext TextSample.

Teletext input generates both a region with prefix ttx_
and a floating point line number (e.g. 9.5) in the
range 0 to 11.5 (due to input 0-23 as double lines).

The output is adopted to drop such regions
and convert the line number to an integer
since the standard only used floats for percent
values but not for plain line numbers.
…#879)

Set the start number in representation to the segment index that is sent by muxer.

With this enhancement, you can now specify the initial sequence number
to be used on the generated segments when calling the packager.
With the old implementation, it was always starting with "1".

---------

Co-authored-by: Cosmin Stejerean <[email protected]>
🤖 I have created a release *beep* *boop*
---


##
[3.1.0](v3.0.4...v3.1.0)
(2024-05-03)


### Features

* add missing DASH roles from ISO/IEC 23009-1 section 5.8.5.5
([#1390](#1390))
([fe885b3](fe885b3))
* get start number from muxer and specify initial sequence number
([#879](#879))
([bb104fe](bb104fe))
* teletext formatting
([#1384](#1384))
([4b5e80d](4b5e80d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
…1394)

After change to add forced command line ordering adaptation set IDs in
places were referenced by their sort index (the minimum representation
index they contained).

Instead always refer to adaptation sets by their own ID, and use the
index only as an optional sort key.

Fixes #1393
The option was never covered to the widevine docs when it was added,
requiring someone to read the source code or the --help to discover this
option.

Fixes #983
Currently `media_info.media_file_url()` is not escaped when placed into
MPD for things like BaseURL. This for example breaks when trying to us a
file name that contains special characters like &. Since these are
supposed to be URLs let's URL encode them.

Fixes #1107

---------

Co-authored-by: Joey Parrish <[email protected]>
If color_space is VPX_COLOR_SPACE_SRGB, the specs says that color_range
should be 1 i.e. yuv_full_range = true. 

However, yuv_full_range was initialized as false and wasn't set in the branch for color_space
is VPX_COLOR_SPACE_SRGB.

Fixes #990

---------

Co-authored-by: Joey Parrish <[email protected]>
…nd DASH (#1396)

Support Dolby Vision profile 8.1, 8.2, 8.4, 10.1, 10.4 signaling in HLS
and DASH.

Adds new option `--use_dovi_supplemental_codecs` (off by default) to use
SUPPLEMENTAL-CODECS in HLS and `scte214:supplementalCodecs` and
`scte214:supplementalProfiles` for DASH.

To maintain compatibility with existing players the current behavior of
using two entries in the manifest remains the default. This will be
changed in a future version where `use_dovi_supplemental_codecs` will
become on by default.

Adds Dolby Vision compatible brands, 'db1p', 'db2g', 'db4g', 'db4h',
'dby1' based on https://mp4ra.org/#/brands

---------

Co-authored-by: Xingzhao Yun <[email protected]>
🤖 I have created a release *beep* *boop*
---


##
[3.2.0](v3.1.0...v3.2.0)
(2024-05-11)


### Features

* support Dolby Vision profile 8.x (HEVC) and 10.x (AV1) in HLS and DASH
([#1396](#1396))
([a99cfe0](a99cfe0))


### Bug Fixes

* adaptation set IDs were referenced by lowest representation ID
([#1394](#1394))
([94db9c9](94db9c9)),
closes
[#1393](#1393)
* escape media URLs in MPD
([#1395](#1395))
([98b44d0](98b44d0))
* set yuv full range flag to 1 for VP9 with sRGB
([#1398](#1398))
([f6f60e5](f6f60e5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
@kevleyski kevleyski merged commit 35bb5f9 into kevleyski:main May 15, 2024
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.