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

feat: sync upstream main #32

Merged
merged 68 commits into from
Jun 3, 2024
Merged

feat: sync upstream main #32

merged 68 commits into from
Jun 3, 2024

Conversation

chenda6
Copy link
Collaborator

@chenda6 chenda6 commented May 29, 2024

No description provided.

wjywbs and others added 30 commits November 29, 2023 22:33
CC version 13 needs `<cstdint>` to be explicitly included to
provide fixed bits integer types.

Some files using it inludes `<stdint.h>`, some are missing direct or
undirect inclusion. This PR adds `<cstdint>` inclusion to the
minimal set of files, allowing compilation on GCC 13.

Closes shaka-project#1305
…ct#1310)

This work was done over ~80 individual commits in the `cmake` branch,
which are now being merged back into `main`. As a roll-up commit, it is
too big to be reviewable, but each change was reviewed individually in
context of the `cmake` branch. After this, the `cmake` branch will be
renamed `cmake-porting-history` and preserved.

---------

Co-authored-by: Geoff Jukes <[email protected]>
Co-authored-by: Bartek Zdanowski <[email protected]>
Co-authored-by: Carlos Bentzen <[email protected]>
Co-authored-by: Dennis E. Mungai <[email protected]>
Co-authored-by: Cosmin Stejerean <[email protected]>
Co-authored-by: Carlos Bentzen <[email protected]>
Co-authored-by: Cosmin Stejerean <[email protected]>
Co-authored-by: Cosmin Stejerean <[email protected]>
…1319)

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.
shaka-project#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 shaka-project#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.
…ject#1323)

The current mbedtls integration was not working for some modes. See for
example shaka-project#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 shaka-project#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.
…haka-project#369) (shaka-project#1311)

Part of shaka-project#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 shaka-project#1327), and also
removes the need for hacks around vlog flags.
The issues we had with zlib and CMake have been resolved upstream.
…oject#1329)

This will force the muxer to order streams in the order given on the
command-line.

Closes shaka-project#560
Closes shaka-project#1280
Closes shaka-project#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 shaka-project#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 shaka-project#1325
…ly (shaka-project#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]>
…shaka-project#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 shaka-project#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 shaka-project#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 shaka-project#1347
This is based on comments at
shaka-project#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 shaka-project#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 shaka-project#272

---------

Co-authored-by: Marcus Spangenberg <[email protected]>
…a-project#1346)

Add startwithSAP/subsegmentstartswithSAP for aac, ac3, ec3 and ac4 audio tracks according to LIVE or VOD profile.

Replaces shaka-project#1055
Partial solution for shaka-project#364

---------

Co-authored-by: Xingzhao Yun <[email protected]>
Co-authored-by: Joey Parrish <[email protected]>
An updated version of PR shaka-project#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
shaka-project#685 (comment).
Try the command without it if you want to.

Fixes shaka-project#685
Fixes shaka-project#1017

---------

Co-authored-by: Daniel Cantarín <[email protected]>
shaka-bot and others added 18 commits March 12, 2024 13:14
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 shaka-project#1378
🤖 I have created a release *beep* *boop*
---


## [3.0.4](shaka-project/shaka-packager@v3.0.3...v3.0.4) (2024-03-27)


### Bug Fixes

* BaseURL missing when MPD base path is empty ([shaka-project#1380](shaka-project#1380)) ([90c3c3f](shaka-project@90c3c3f)), closes [shaka-project#1378](shaka-project#1378)
* Fix NPM binary selection on ARM Macs ([shaka-project#1376](shaka-project#1376)) ([733af91](shaka-project@733af91)), closes [shaka-project#1375](shaka-project#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 shaka-project#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.
…shaka-project#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](shaka-project/shaka-packager@v3.0.4...v3.1.0)
(2024-05-03)


### Features

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

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
…haka-project#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 shaka-project#1393
…a-project#1399)

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 shaka-project#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 shaka-project#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 shaka-project#990

---------

Co-authored-by: Joey Parrish <[email protected]>
…nd DASH (shaka-project#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](shaka-project/shaka-packager@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
([shaka-project#1396](shaka-project#1396))
([a99cfe0](shaka-project@a99cfe0))


### Bug Fixes

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

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
@chenda6 chenda6 self-assigned this May 29, 2024
@chenda6 chenda6 changed the title feat : sync upstream main feat: sync upstream main May 29, 2024
@chenda6 chenda6 merged commit 3a7f4f0 into main Jun 3, 2024
31 checks passed
@chenda6 chenda6 deleted the feature/sync-upstream-main branch June 3, 2024 18:54
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.