1587 Commits

Author SHA1 Message Date
Joey Parrish
3564954940 docs: add AGENTS.md for AI coding agents (#1569)
Some checks failed
Release / Settings (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Update Issues / update-issues (push) Has been cancelled
Co-authored-by: Claude Code (Claude Sonnet 4.6) <noreply@anthropic.com>
2026-03-31 17:31:19 -07:00
Shaka Bot
454f193fc3 chore(main): release 3.7.1 (#1565)
🤖 I have created a release *beep* *boop*
---


##
[3.7.1](https://github.com/shaka-project/shaka-packager/compare/v3.7.0...v3.7.1)
(2026-03-22)


### Bug Fixes

* resolve relative paths for atomic write target
([#1564](https://github.com/shaka-project/shaka-packager/issues/1564))
([90a392e](90a392ed8a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
v3.7.1
2026-03-31 15:10:36 -07:00
Shaka Bot
60c86bb08a chore: Sync policy documents (#1568)
This is an automated sync of policy documents for this organization.
The upstream source is:

d4bd439fb6

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2026-03-31 15:06:00 -07:00
Niklas Korz
90a392ed8a fix: resolve relative paths for atomic write target (#1564)
Some checks failed
Sync Labels / sync-labels (push) Has been cancelled
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Fixes #1383

This solves an edge case where the target path of an atomic write is
a relative path without a directory part.
In this case, the temporary file was written to the system's tempdir
before, which may then fail the atomic rename as the tempdir often
is on a different device such as tmpfs.
2026-03-22 12:19:21 -07:00
Shaka Bot
bd1648389b chore(main): release 3.7.0 (#1555)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Sync Labels / sync-labels (push) Has been cancelled
v3.7.0
2026-03-20 09:53:56 -07:00
Niklas Korz
1e5fa9ab28 fix(deps): update to curl v8.19.0, mbedtls v3.6.5, libxml2 v2.15.2 (#1563)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
These are security sensitive dependencies that haven't been updated
since 2024.

Thankfully, there do not appear to be any major incompatibilities that
prevent an update.

libxml2 now enforces that buffer size must only refer to the actual
content excluding the null terminator, which required replacing
`std::size` with `strlen` in two unit tests.

I originally tried to bump mbedtls to 4.0.0, but that seems to be
blocked by an upstream issue trying to write to the cmake source
directory, which cmake errors on.

3.6.5 has all CVE fixes included that come with 4.0.0 though, so from a
security perspective it is sufficient to update to this version with no
incompatibilities first.

---------

Co-authored-by: Joey Parrish <joeyparrish@google.com>
2026-03-18 18:31:57 -07:00
Niklas Korz
27a1d71e3d fix(deps): update abseil-cpp to 20260107.1, protobuf to 33.5 (#1553)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
All deprecations have been addressed in this PR and Protobuf has been
updated to 33.5 as older versions lead to build failures on Linux with
this abseil-cpp version.
2026-03-17 20:48:13 -07:00
Niklas Korz
2c6790a8cb feat(cmake): allow using system dependencies (#1562)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Another of our currently vendored patches for nixpkgs / NixOS that has
been in use for about two years, hidden behind an option to allow both
variants to coexist.

The idea is that opting into `USE_SYSTEM_DEPENDENCIES` works without any
submodules, so when this option is enabled, we also expect the system to
already have Python with the `google.protobuf` module ready and
available.
2026-03-16 10:25:20 -07:00
Joey Parrish
45151e4d50 chore: Massive style update (#1561)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
This was done by git clang-format v18. Results are the same up to v22.
Newer versions were not tested.

Commands:

```
FIRST_SHA1=58a19df
git clang-format --style Chromium $FIRST_SHA1
git commit -a
```

From now on, we won't have to trip over ancient style issues from other
parts of a file we're working on.

"Probability factor of one to one. We have normality. I repeat, we have
normality. Anything you still can't cope with is therefore your own
problem." ~Douglas Adams
2026-03-15 14:22:33 -07:00
Joey Parrish
e8c2b9f598 ci: Pin clang-format-18 in linter workflow (#1560)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Sync Labels / sync-labels (push) Has been cancelled
Also drop the explicit --style argument, letting .clang-format rule
2026-03-14 16:27:30 -07:00
Joey Parrish
ca04689c94 ci: Make linting happen entirely in parallel (#1556)
It has been very, very annoying lately to have PRs get stuck in several
loops of linter failures without finding out if the thing builds or
passes tests. From now on, lint in parallel with everything else.
2026-03-14 16:05:45 -07:00
Joey Parrish
9ee1b108bb style: protect structured byte arrays from clang-format (#1557)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Add clang-format off/on markers inside arrays that contain inline
structural comments (NAL unit sections, codec config fields, PSI tables,
encryption metadata, etc.) so their layout survives a clang-format run.

Arrays with no internal comments are left unguarded so clang-format can
reflow them freely.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 09:24:39 -07:00
Joey Parrish
0c8f8bd30e style: Standardize the linter version (#1558)
Also fix check_formatting.py to work as a pre-commit hook again.
2026-03-14 09:20:18 -07:00
Ferdian Atmadiputra
34352c16d3 fix: correct WebM color range value mapping for vpcC and colr boxes (#1554)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Per the Matroska specification, Color.Range 1 means broadcast/limited
(not full), and 2 means full range. The previous mapping treated value 1
as full range, causing incorrect video_full_range_flag in both the vpcC
and colr boxes.

https://www.matroska.org/technical/elements.html\#:\~:text\=Clipping%20of%20the%20color%20ranges.%0A0%20%2D%20unspecified%2C%0A1%20%2D%20broadcast%20range%2C%0A2%20%2D%20full%20range%20\(no%20clipping\)%2C%0A3%20%2D%20defined%20by%20MatrixCoefficients%20/%20TransferCharacteristics
2026-03-13 20:26:56 -07:00
Niklas Korz
8431c336c2 feat(cmake): allow external declaration of version string (#1552)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
In nixpkgs, we derive the version from the package definition's version
attribute.

As we only fetch the tarball instead of the full git repository, trying
to derive the version from git fails.

We have been using this patch in nixpkgs since 2024, so upstreaming it
would be appreciated!
2026-03-13 11:29:22 -07:00
Shaka Bot
74aaef916f chore(main): release 3.6.1 (#1550)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
v3.6.1
2026-03-12 17:04:58 -07:00
Xavier Laffargue
16a2462dd8 fix: HLS - remove CLOSED-CAPTIONS from EXT-X-I-FRAME-STREAM-INF (#1551)
This PR removes the CLOSED-CAPTIONS attribute (and a few others) from
the EXT-X-I-FRAME-STREAM-INF tag in the HLS master playlist.

According to the HLS RFC (Section 4.4.6.3), the CLOSED-CAPTIONS
attribute is not defined for EXT-X-I-FRAME-STREAM-INF tags. Including it
causes non-compliance and may result in playback issues on strictly
compliant players.

References
[RFC 8216 Section
4.4.6.3](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-16#section-4.4.6.3)

Affected version : >= 2.5

---------

Co-authored-by: Xavier Laffargue <xavier.laffargue@radio-canada.ca>
2026-03-12 16:10:57 -07:00
Cosmin Stejerean
e46b7591e1 fix: Upgrade deps that are meant for older versions of CMake (#1508)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Current deps require an old CMake version, support for which has been
removed from latest CMake in Ubuntu and Arch.

```
CMake Error at packager/third_party/c-ares/source/CMakeLists.txt:3 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 has been removed from CMake.
```

This upgrades:
 - abseil-cpp, 20240116.0 => 20260107.1
 - c-ares, v1.20.1 => v1.34.5
 - json, v3.10.1-115-g954b10ad => v3.12.0
 - libwebm, 1.0.0.28 => 1.0.0.32

With these changes, the build has been verified with CMake 3.31.11
(latest v3) and CMake 4.2.3 (latest v4).

---------

Co-authored-by: Joey Parrish <joeyparrish@google.com>
2026-03-11 18:24:15 -07:00
Torbjörn Einarsson
19dbd203b0 fix: DVB-Teletext: heartbeat mechanism and segment alignment with video/audio (#1535)
I've finally generated test material and tests to make a PR to fix text
segment generation for MPEG-2 TS streams with sparse teletext data,
making a big improvement compared to the original teletext support in
#1344.


## Problem

When packaging MPEG-TS input containing DVB-Teletext subtitles for
DASH/HLS output, two fundamental issues arise:

1. **Sparse input handling** - Teletext streams only contain data when
subtitles are displayed. During gaps (which can span multiple segments),
no PES packets arrive, leaving the text chunker with no timing
information to drive segment generation. This results in missing
segments or segments with incorrect timing.

2. **Misaligned segment boundaries** - Even when segments are generated,
the text segment timestamps and boundaries differ from video/audio
segments. This causes `<SegmentTimeline>` mismatches in the MPD,
playback issues on some players, and sometimes fewer text segments than
video segments.

## Solution

This PR introduces two complementary mechanisms:

### 1. Heartbeat mechanism (sparse input handling)

The `Mp2tMediaParser` now sends periodic "heartbeat" signals to text
streams:

- Video PTS timestamps are forwarded to all text PIDs as
`MediaHeartBeat` samples
- `EsParserTeletext` emits `TextHeartBeat` samples when PES packets
arrive without displayable content
- `TextChunker` uses these heartbeats to drive segment generation even
during gaps in subtitle content
- Ongoing cues that span segment boundaries are properly split and
continued

A new `heartbeat_shift` stream descriptor parameter (default: 2 seconds
at 90kHz) controls the timing offset between video PTS and text segment
generation, compensating for pipeline processing delays.

### 2. SegmentCoordinator (segment boundary alignment)

A new N-to-N media handler (`SegmentCoordinator`) ensures text segments
align precisely with video:

- Passes all streams through unchanged
- Replicates `SegmentInfo` from video/audio `ChunkingHandler` to
registered teletext streams
- `TextChunker` in "coordinator mode" uses received `SegmentInfo` events
to determine segment boundaries instead of calculating from text
timestamps

This guarantees identical segment timelines across all adaptation sets.

## Testing

- **Integration tests** in `packager_test.cc`:
- `TeletextSegmentAlignmentTest.VideoAndTextSegmentsAligned` - Verifies
segment count, start times, and durations match between video and text
-
`TeletextSegmentAlignmentTest.VideoAndTextSegmentsAlignedWithWrapAround`
- Same verification with PTS timestamps near the 33-bit wrap-around
point (~26.5 hours)

- **Test files** (synthetic teletext with known cue timings at 1.0s,
3.5s, 13.0s):
  - `test_teletext_live.ts` - Normal PTS range
  - `test_teletext_live_wrap.ts` - PTS near wrap-around boundary

- **Unit tests** for `SegmentCoordinator` and updated `TextChunker`
tests

## Documentation

- Extended `docs/source/tutorials/text.rst` with DVB-Teletext section
covering:
  - Page numbering (3-digit cc_index format)
  - Heartbeat mechanism explanation
  - Segment alignment behavior
  - `--ts_ttx_heartbeat_shift` parameter tuning
  - Troubleshooting guide

- Added teletext processing pipeline diagram to `docs/source/design.rst`

## Future work

The heartbeat and `SegmentCoordinator` mechanisms would likely benefit
**DVB-SUB (bitmap subtitles)** as well (Issue #1477) , which faces
similar challenges with sparse subtitle data in MPEG-TS input and
segment alignment. The infrastructure is now in place to extend this
support.

## Example usage

```bash
packager \
  --segment_duration 6 \
  --mpd_output manifest.mpd \
  'in=input.ts,stream=video,init_segment=video/init.mp4,segment_template=video/$Number$.m4s' \
  'in=input.ts,stream=audio,init_segment=audio/init.mp4,segment_template=audio/$Number$.m4s' \
  'in=input.ts,stream=text,cc_index=888,lang=en,init_segment=text/init.mp4,segment_template=text/$Number$.m4s,dash_only=1'
```


Fixes #1428
Fixes #1401
Fixes #1355
Fixes #1430
2026-03-11 16:06:30 -07:00
Shaka Bot
c9fa9908c3 chore(main): release 3.6.0 (#1548)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
v3.6.0
2026-03-11 12:24:55 -07:00
Xavier Laffargue
51e25b56ee feat: DASH - Add signaling for CEA-608/708 captions (#1549)
This change introduces support for signaling CEA-608 and CEA-708 closed
captions in DASH. (Equivalent of
https://github.com/shaka-project/shaka-packager/pull/1532)

It reuses the existing --closed_captions command-line flag. Note that
some options (name, autoselect, and default) are not used for DASH.


```
--closed_captions 'channel=CC1,lang=fra;channel=CC2,lang=eng;channel=SERVICE1,lang=eng'
```


For Dash this adds an Accessibility tag in each video AdaptationSet.

Example output : 
```
<AdaptationSet id="1" contentType="video" ....>
      <Accessibility schemeIdUri="urn:scte:dash:cc:cea-608:2015" value="CC1=fra"/>
      <Accessibility schemeIdUri="urn:scte:dash:cc:cea-608:2015" value="CC2=eng"/>
      <Accessibility schemeIdUri="urn:scte:dash:cc:cea-708:2015" value="1=lang:eng"/> 
```

HLS changes :
* We force the language to 2 characters to be consistent with the
language of the audio files, for example.
* closed_captions is now in packaging_params
2026-03-11 10:55:52 -07:00
faushine1
3e854f4c90 feat: add subsample encryption support for Dolby AC-4 (#1522)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
**Description**

This PR introduces support for subsample encryption for Dolby AC-4 audio
streams including muxing and packaging in Shaka Pakager.

**Motivation**

Subsample encryption is a mode of Common Encryption (CENC) that allows
selective encryption of media samples, leaving specific portions (such
as headers) in the clear. In most cases, subsample encryption is applied
to video streams (e.g., H.265/HEVC or AV1). It can also be used for
audio streams, even though many pipelines default to full-sample
encryption for audio. For Dolby AC-4, this is particularly useful
because the AC-4 frame header (ac4_toc) contains configuration data that
must remain accessible to parsers and playback systems even when the
rest of the frame is encrypted.
By implementing subsample encryption for AC-4:
- Parsers can validate and process encrypted streams without full
decryption.
- Playback systems can perform certain bitstream operations (e.g.,
stream identification, sync validation) efficiently.
- This aligns with best practices for encrypted media delivery and
improves performance with streaming platforms.

**Implementation Details**

- The implementation ensures that the ac4_toc() portion of each AC-4
frame remains unencrypted.
- The remaining payload is encrypted using the selected CENC protection
scheme (e.g., cbcs or cenc).

**Specification Reference**

This feature is not mentioned in any published specification. However,
it is discussed in detail in the specification, which has not yet been
publicly released but is expected to be published in the near future.
Once available, it will provide formal guidance on subsample encryption
for AC-4, including the handling of the ac4_toc() structure and
encryption boundaries.

**Notes**

- This implementation is compatible with the upcoming public release of
the AC-4 ISOBMFF specification.
- The feature has been tested on encryption/decryption, DASH, HLS, and
DRM. The generated content is conforms to expected encryption behavior.
- Additional documentation will be provided once the specification is
officially published.

---------

Co-authored-by: Xingzhao Yun <xyun@dolby.com>
2026-03-09 09:06:58 -07:00
Xavier Laffargue
6c7fb18d3b fix: AdaptationSet ID inconsistency across periods (#1547)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Sync Labels / sync-labels (push) Has been cancelled
Fixes https://github.com/shaka-project/shaka-packager/issues/1546
2026-03-07 10:28:57 -08:00
Ronak Patel
ef8ed345de feat: Switch VOD to live stream when event/live streams end (#1541)
Implement the MPEG DASH/HLS specifications to switch event/live streams
to VOD when the streams end. Use --event_to_vod_on_end_of_stream.

This change implements the DASH standard by:

1. Change MPD@type to static
2. Set MPD@mediaPresentationDuration to the media duration
3. Removing dynamic specific attributes in element, e.g.
availabilityStartTime, minimumUpdatePeriod, timeShiftBufferDepth etc.
4. Set SegmentTemplate@presentationTimeOffset in Representations

This change implements the HLS standard by:

1. Switch the PLAYLIST-TYPE to VOD at the conclusion of a LIVE stream
2. Append an EXT-X-ENDLIST tag at the end of the stream

Fixes #321
2026-03-07 09:33:41 -08:00
Shaka Bot
3fc1660867 chore(main): release 3.5.0 (#1491)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
v3.5.0
2026-03-04 19:53:41 -08:00
Jacob Trimble
e981da5ad8 fix: Move cipher block align to start of block (#1540)
Before, we would add clear ranges to the start of the subsample,
therefore moving the encrypted start further into the video frame; now
we add clear ranges to the end by adding a new subsample (if needed).

This seems more correct. Both are allowed by the spec, but it would be
better to encrypt the beginning of the frame to give attackers less info
about the start of the frame. Having the clear data at the end of the
frame doesn't give attackers much info since most data depends on the
encrypted state.
2026-03-04 18:57:54 -08:00
Xavier Laffargue
3aafed82b6 feat: Add signaling for CEA-608/708 captions (#1532)
This change introduces support for signaling CEA-608 and CEA-708 closed
captions in HLS.

New command-line flags, `--closed_captions`, have been added to allow
users to specify the caption tracks. The format for these flags is a
comma-separated list of semicolon-separated key-value pairs, e.g.,

`--closed_captions

"channel=CC1,name=French,lang=fra,default=no,autoselect=yes;channel=SERVICE1,name=English,lang=eng,default=yes,autoselect=yes"`.

For HLS, this change adds `#EXT-X-MEDIA` tags for each caption track
with a common `GROUP-ID` of "cc". The `EXT-X-STREAM-INF` tag for video
streams has been updated to reference this `GROUP-ID`.

Dash will be supported in another PR.

Fixes #986
2026-03-04 17:08:33 -08:00
김은빈
6144a49701 fix: handle EEXIST error in directory creation (#1526)
Fix incorrect error handling in `LocalFile::Open()` when
`create_directories()` encounters an already-existing directory.

  ### Problem

The current code treats `create_directories()` returning `false` as a
failure:

  ```cpp
  if (!std::filesystem::create_directories(parent_path, ec)) {
    return false;  // BUG: ec is not checked
  }
  ```

However, according to the C++ standard,
[std::filesystem::create_directories()](https://en.cppreference.com/w/cpp/filesystem/create_directory.html):
  - Returns true if a new directory was created
- Returns false with ec.clear() if the directory already exists (not an
error)
  - Returns false with ec set if an actual error occurred

  This causes failures in several scenarios:
1. Concurrent packaging: Multiple threads creating the same output
directory
2. External directory creation: Another process creates the directory
between is_directory() check and create_directories()
  call
3. Retry after partial failure: Directory was created in a previous
failed attempt

  ### Example Failure (strace)

  ```bash
  newfstatat("/tmp/out/dir") = -1 ENOENT      ← Directory doesn't exist
mkdirat("/tmp/out/dir", 0777) = -1 EEXIST ← Created by another
process/thread
exit(0) ← Packager exits without writing output
  ```

The directory exists and is ready to use, but the code incorrectly
treats this as a failure.

###  Solution

Check the error_code after create_directories() returns false. Only
return failure if ec indicates an actual error.

  ```cpp
  if (!std::filesystem::create_directories(parent_path, ec)) {
    if (ec) {  // Only fail if there's an actual error
      return false;
    }
    // ec is empty means directory already exists - continue normally
  }
  ```

---------

Co-authored-by: Joey Parrish <joeyparrish@google.com>
2026-03-04 17:07:04 -08:00
Jacob Trimble
a792c567c7 feat: Add CENC v1 support (#1539)
CENC v1 (--cencv1) allows generating legacy content for testing purposes.
2026-03-04 17:06:43 -08:00
SteveR-PMP
4fad8d01c0 feat: --local_targetduration (#1519)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Change EXT-X-TARGETDURATION to have the value set to the highest
duration for each variant instead of the highest duration for all the
variants.

Fixes #1510
2026-03-04 14:48:15 -08:00
Ferdian Atmadiputra
8dd9a6d588 fix: Fix color range info loss in WebM input to init mp4 packaging (#1517)
WebM color range metadata was not being converted to MP4 colr box
format, causing incorrect color range value and video may look washed
out. Add colr box generation for VP8/VP9 codecs in WebMVideoClient.

Fixes #1515
2026-03-04 14:47:22 -08:00
Joey Parrish
4b3d1f98f9 fix(ci): Update release for trusted publishing to NPM (#1544)
This handles trusted publishing for Shaka Packager to NPM without
tokens.

This also updates upload/download actions, and adds a filter on specific
artifacts downloaded to avoid conflicts that have arisen since the last
release.

Also updates the images used in the build matrix.

Issue shaka-project/shaka-player#9132
2026-03-04 13:30:04 -08:00
Xavier Laffargue
73b4048492 feat: Add support for EXT-X-PROGRAM-DATE-TIME tag (#1521)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Sync Labels / sync-labels (push) Has been cancelled
Inspired by @r0ro
https://github.com/shaka-project/shaka-packager/pull/840

Add a new --add_program_date_time HLS flag to enable or disable this
feature.

Introduces support for the EXT-X-PROGRAM-DATE-TIME tag in HLS media
playlists, aligning with the HLS RFC specifications.

Closes #365
2025-11-21 17:54:58 -08:00
Joey Parrish
7cd7e48e9c fix: Upgrade libpng to fix build on new macs (#1507)
This upgrades libpng from v1.6.37 to v1.6.50

This newer libpng doesn't assume the existence of fp.h on Mac (which
isn't present on newer ones), but the CMake options for libpng changed
and had to be adjusted somewhat.
2025-11-21 11:13:11 -08:00
SteveR-PMP
5776b0b60d fix: Fix supplemental properties pointing to wrong AdaptationSet IDs (#1520)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Sync Labels / sync-labels (push) Has been cancelled
Fixes #1500
2025-10-15 14:32:12 -07:00
Joey Parrish
b1c79e5052 chore: Fix build in Arch and other dockers (#1506)
Some checks failed
Update Issues / update-issues (push) Has been cancelled
Release / Settings (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Sync Labels / sync-labels (push) Has been cancelled
This adds missing cstdint headers in every header where we reference a
uint*_t.

This also adds a cmake definition that works around a guard in newer
cmakes that is meant to guard against libraries that only work in older
ones. (`-DCMAKE_POLICY_VERSION_MINIMUM=3.5`)
2025-08-12 11:41:25 -07:00
Joey Parrish
71ef59150f ci: Use a mirror of musl.cc (#1505)
musl.cc is overwhelmed by GitHub traffic, and therefore has blocked all
of Microsoft. This switches to a mirror run on GitHub so that we can
continue to access the toolchains.
2025-08-08 11:00:37 -07:00
Xavier Laffargue
f6a1a35e28 fix: HLS identity key added inappropriately (#1499)
The `SimpleHlsNotifier::NotifyEncryptionUpdate` method was modified : 
When this method is called with the Common System ID, it now checks if
the stream's encryption method is CENC. If it is CENC, the notifier
skips adding the EXT-X-KEY tag with KEYFORMAT="identity", as CENC
content should be handled by the specific DRM system's key format (e.g.,
Widevine's urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed).

Closes #1439

---------

Co-authored-by: Joey Parrish <joeyparrish@google.com>
2025-08-08 10:37:11 -07:00
Danny Hong
c22c379123 feat: MV-HEVC support for stereo video (#1488)
Some checks failed
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Update Issues / update-issues (push) Has been cancelled
Sync Labels / sync-labels (push) Has been cancelled
Adding MV-HEVC support limited to stereo video, issue #1483.
Stereo video coded in MV-HEVC is becoming more widely available: Apple
Vision Pro supports stereo video playback in MV-HEVC and both the
headset and iPhone supports capturing stereo video using the format.
FFmpeg has also added support for MV-HEVC.

Note that this PR is only focusing on adding MV-HEVC support to .mp4 for
encryption/decryption support. Proper HLS and DASH support will still
need to be added.
2025-03-18 18:00:40 -06:00
Joey Parrish
9a6b2a50c0 feat(ci): Official multiarch docker images for x64 + arm64 (#1490)
Some checks failed
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Sync Labels / sync-labels (push) Has been cancelled
This adds support for Docker-based testing on arm64 images and runners.

This also adds a multiarch build process so that future releases cover
both x64 and arm64.

This is tagged as "feat" so that this gets called out in the changelog
for the next release.
2025-03-15 11:56:24 -07:00
Joey Parrish
0cb47b1ab3 ci: Update OpenSUSE dockerfile to 15.6 (#1489)
Some checks are pending
Release / Settings (push) Waiting to run
Release / release (push) Blocked by required conditions
Release / Compute latest release flag (push) Blocked by required conditions
Release / Update docs (push) Blocked by required conditions
Release / Update docker image (push) Blocked by required conditions
Release / Build (push) Blocked by required conditions
Release / Artifacts (push) Blocked by required conditions
Release / Update NPM (push) Blocked by required conditions
We no longer need a separate repo for CMake.

This fixes build failures on OpenSUSE 15.5. The extra repo for CMake is
no longer available. So it's lucky we no longer need it with the latest
OS.
2025-03-14 12:06:53 -07:00
Shaka Bot
c819deaa23 chore(main): release 3.4.2 (#1473)
Some checks failed
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Sync Labels / sync-labels (push) Has been cancelled
Update Issues / update-issues (push) Has been cancelled
v3.4.2
2025-01-17 14:19:28 -08:00
Joey Parrish
89d59a3601 ci: Update comments for the settings workflow (#1476)
Since the introduction of `vars` to GitHub Actions, I started using that
instead of the "environments" trick I used in Packager. However, it has
become clear now that the `vars` strategy has major drawbacks, such as
requiring the use of `pull_request_target`, which should only be used
for actions that do not execute PR-author-controlled code.

This updates the comments to clarify why this is used. This reusable
settings workflow will also be deployed now in other repos to
standardize on this "environments" mechanism, which is safer than
`vars`.
2025-01-17 14:18:54 -08:00
Joey Parrish
565fec5262 ci: Stop using self-hosted Linux/arm64 runners (#1474)
Some checks are pending
Release / release (push) Blocked by required conditions
Release / Settings (push) Waiting to run
Release / Compute latest release flag (push) Blocked by required conditions
Release / Update docs (push) Blocked by required conditions
Release / Update docker image (push) Blocked by required conditions
Release / Build (push) Blocked by required conditions
Release / Artifacts (push) Blocked by required conditions
Release / Update NPM (push) Blocked by required conditions
These are no longer required since GitHub launched their own Linux/arm64
runners.

See
https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/
2025-01-16 18:37:01 -08:00
Joey Parrish
b882572b54 fix(ci): Fix incomplete 3.4.1 release (#1471)
Some checks are pending
Release / Settings (push) Waiting to run
Release / release (push) Blocked by required conditions
Release / Compute latest release flag (push) Blocked by required conditions
Release / Update docs (push) Blocked by required conditions
Release / Update docker image (push) Blocked by required conditions
Release / Build (push) Blocked by required conditions
Release / Artifacts (push) Blocked by required conditions
Release / Update NPM (push) Blocked by required conditions
google-github-actions/release-please-action has been deprecated and
replaced with googleapis/release-please-action.
2025-01-16 15:44:10 -08:00
Joey Parrish
ea48ee46bf ci: Upgrade pylint to support Python 3.12 (#1472)
Some checks failed
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Sync Labels / sync-labels (push) Has been cancelled
Also fixes issues raised by the newer, stricter pylint
2025-01-10 08:11:04 -08:00
Shaka Bot
8b52868269 chore(main): release 3.4.1 (#1463)
Some checks failed
Release / Settings (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
v3.4.1
2024-12-20 13:55:22 -08:00
Shaka Bot
f8460a6794 chore: Sync policy documents (#1467)
This is an automated sync of policy documents for this organization.
The upstream source is:

de0823bbe4

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2024-12-20 13:54:49 -08:00
Joey Parrish
038b8571a3 ci: Update nodejs to a maintained version (#1466)
Some checks are pending
Release / release (push) Blocked by required conditions
Release / Compute latest release flag (push) Blocked by required conditions
Release / Update docs (push) Blocked by required conditions
Release / Update docker image (push) Blocked by required conditions
Release / Build (push) Blocked by required conditions
Release / Settings (push) Waiting to run
Release / Artifacts (push) Blocked by required conditions
Release / Update NPM (push) Blocked by required conditions
2024-12-19 17:53:50 -08:00
Shaka Bot
091f0f3e03 chore: Sync common workflows (#1465)
Some checks failed
Release / Settings (push) Has been cancelled
Release / Update NPM (push) Has been cancelled
Release / release (push) Has been cancelled
Release / Compute latest release flag (push) Has been cancelled
Release / Update docs (push) Has been cancelled
Release / Update docker image (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Artifacts (push) Has been cancelled
This is an automated sync of common workflows for this organization.
The upstream source is:

be928d3061

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2024-12-18 08:35:37 -08:00