Skip to content

Add opt-in setting to avoid AV1 fMP4-HLS playback failure on Tizen - #484

Closed
Licaa21 wants to merge 3 commits into
Moonfin-Client:mainfrom
Licaa21:fix/av1-fmp4-fallback
Closed

Licaa21 wants to merge 3 commits into
Moonfin-Client:mainfrom
Licaa21:fix/av1-fmp4-fallback

Conversation

@Licaa21

@Licaa21 Licaa21 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

On my Samsung QE65Q67AAUXXH (2021, Tizen 6.0), a 4K AV1 (Dolby Vision Profile 8, HDR10 base) MKV with a DTS-HD MA audio track fails about 1.8 seconds after AVPlay opens the stream (PLAYER_ERROR_CONNECTION_FAILED then PLAYER_ERROR_NOT_SUPPORTED_FILE). The server does its job correctly: ffmpeg copies the AV1 video stream untouched (-codec:v:0 copy) and only transcodes the DTS-HD MA audio to AC3, into fMP4-segmented HLS, because that's the only transcoding profile that lists av1 as an acceptable video codec (deviceProfile.js).

I confirmed this is specifically the fMP4-HLS wrapper, not AV1 decoding itself:

  • A sample cut from the same file with ffmpeg -c:v copy -c:a ac3 into a plain MKV (no HLS, no fMP4) direct-plays fine on the same TV.
  • Samsung's own 2021 spec docs list AV1 up to 3840x2160 as supported on this tier.
  • The Dolby Vision metadata isn't the cause either — the ffmpeg log shows it explicitly declined to write the dvcC/dvvC box (Not writing 'dvcC'/'dvvC' box. Requires -strict unofficial.), so no DV metadata reached the player.
  • Routing AV1 through the ts container instead of mp4/fMP4 isn't an option: ffmpeg's mpegts muxer has no real AV1 support (AV1-over-MPEG-TS is only a draft spec).

So on this TV/firmware, AV1 video copied into fMP4-segmented HLS specifically breaks, even though the same AV1 stream plays fine directly and other files that transcode through the ts/HEVC path work fine on this same hardware.

Related Issues

  • Related to: none filed yet

Type of Change

  • Bug fix
  • New feature (adds an opt-in setting)

Changes Made

  • Added a forceCompatibleAv1Transcode setting (off by default) under Settings > Playback > Media Player Behavior, labeled "Force Compatible AV1 Transcode", hidden on webOS since it doesn't apply there
  • When enabled, deviceProfileTuning.js drops the AV1 transcoding profile from the device profile sent to the server, so an AV1 source that needs transcoding falls back to the ts/hevc profile and gets fully re-encoded to HEVC instead of having its AV1 video copied into fMP4 HLS
  • Left the default off: other Tizen sets may transcode AV1-into-fMP4 fine today, and this only has one confirmed-affected device so far, so it shouldn't become the default behavior for everyone
  • Added test coverage for the new profile-tuning behavior

Platform

  • Tizen (Samsung)

Testing

  • Tested on physical device

Test Steps

  1. Enable "Force Compatible AV1 Transcode" in Settings > Playback > Media Player Behavior
  2. Play a 4K AV1 (Dolby Vision Profile 8 / HDR10 base) file with a DTS-HD MA audio track that requires transcoding
  3. Confirmed it now transcodes to HEVC and plays, instead of failing a few seconds in with PLAYER_ERROR_NOT_SUPPORTED_FILE
  4. Confirmed the same file fails the same way as before when the setting is left off (default), to make sure the toggle is what's responsible for the fix

Screenshots

N/A — settings toggle only, no visual change beyond the new row in the settings list

Checklist

  • Code builds successfully
  • Code follows project style and conventions
  • No unnecessary commented-out code
  • No new warnings introduced

…tead of copying into fMP4 HLS

Some Tizen sets fail PLAYER_ERROR_NOT_SUPPORTED_FILE a couple seconds into an AV1 fMP4-HLS transcode even though the same set decodes AV1 fine in a direct-played MKV. The new "Force Compatible AV1 Transcode" toggle (off by default) drops the AV1 transcoding profile so those transcodes fall back to the ts/hevc profile and re-encode instead.
@github-actions github-actions Bot added Bug Something isn't working Feature Request New feature or request Tizen labels Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✅ Build Successful

All platform builds and the test suite passed. You can download the artifacts below.

Platform Status Artifact
webOS ✅ Passed Moonfin_webOS_*.ipk
Tizen Regular ✅ Passed Moonfin_Tizen_Regular_*.wgt
Tizen Oblong ✅ Passed Moonfin_Tizen_Oblong_*.wgt
Tizen Legacy ✅ Passed Moonfin_Tizen_Legacy_*.wgt
Vega ✅ Passed web bundle and shell checks
Property Value
Commit dec1b29
Workflow run Build #421

The forceCompatibleAv1Transcode toggle's label and description were
never added to the source strings.json that Weblate monitors, so they
were never picked up for translation into other languages.
@Licaa21
Licaa21 force-pushed the fix/av1-fmp4-fallback branch from cdd95ee to dec1b29 Compare October 5, 2026 18:42
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
Generated by CodeRabbit — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Moonfin-Client/Smart-TV/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b2a4b4fd-2fb7-4d86-b807-76d326394857
📥 Commits

Reviewing files that changed from the base of the PR and between a6f6d25 and dec1b29.

📒 Files selected for processing (5)
  • packages/app/resources/strings.json
  • packages/app/src/context/defaultSettings.js
  • packages/app/src/utils/deviceProfileTuning.js
  • packages/app/src/utils/deviceProfileTuning.test.js
  • packages/app/src/views/Settings/settingsSchema.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features
    • Added a video playback setting to force compatible transcoding for AV1 content. When enabled, AV1 direct-play profiles are excluded so content can be transcoded to HEVC. The option is hidden on webOS.

Walkthrough

Adds a video playback setting that removes AV1 transcoding profiles during device profile tuning. The setting defaults to off and is hidden on webOS. Its description states that transcoding re-encodes AV1 to HEVC.

Changes

Compatible AV1 Transcoding

Layer / File(s) Summary
Add the AV1 compatibility setting
packages/app/src/context/defaultSettings.js, packages/app/src/views/Settings/settingsSchema.js, packages/app/resources/strings.json
Adds forceCompatibleAv1Transcode, defaulted to false. The setting is available outside webOS and includes English labels and a description of AV1-to-HEVC re-encoding.
Apply the setting to device profiles
packages/app/src/utils/deviceProfileTuning.js, packages/app/src/utils/deviceProfileTuning.test.js
When the setting is enabled, tuning removes transcoding profiles with VideoCodec equal to 'av1'. Tests check that the AV1 profile is removed when enabled and retained when the option is omitted.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: radicalmuffinman

Merge Risk: 🔵 Low · up to dec1b

On Tizen 5.5, enabling the option may produce H.264 rather than the described HEVC output, but a compatible transcode remains available. This is a bounded mismatch and does not materially block merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to dec1b

The option is disabled by default and narrows transcoding choices without changing server selection or credentials. It leaves the original device profile intact. Remaining uncertainty concerns server workload and playback outcomes when compatible re-encoding is requested.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The preference affects profiles offered to the existing selected-server playback path. When an item's cross-server credentials select the alternate API adapter, that adapter accepts only the item ID and does not forward the supplied DeviceProfile body; the new negotiation behavior is therefore not established for that path.

Trust Boundaries and Controls

  • inferred — The new preference controls codec-profile selection, not request destination, credentials, or user identity. The default request continues through the existing authorization-header and user-associated playback endpoint. No new route around those controls is evident in the inspected flow; server enforcement itself was not assessed.

Resilience and Maintainability Implications

  • observed — Existing negotiation retries reuse the tuned profile, while the outer playback fallback invokes negotiation again and reloads stored settings. Fallback does not automatically disable this preference. The inspected client behavior does not establish remote session cleanup or resource recovery guarantees.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the opt-in setting and the Tizen AV1 fMP4-HLS playback issue it addresses.
Description check ✅ Passed The description covers the issue, intended behavior, changes, platform, physical-device testing, test steps, and checklist. It also explains why the setting is off by default.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/app/src/context/defaultSettings.js

Oops! Something went wrong! :(

ESLint: 10.12.0

A config object is using the "root" key, which is not supported in flat config system.

Flat configs always act as if they are the root config file, so this key can be safely removed.

packages/app/src/utils/deviceProfileTuning.js

ESLint skipped: the matched ESLint configuration already failed (config-incompatibility).

packages/app/src/utils/deviceProfileTuning.test.js

ESLint skipped: the matched ESLint configuration already failed (config-incompatibility).

  • 1 others

Comment @coderabbitai help to get the list of available commands.

@Licaa21 Licaa21 closed this Oct 6, 2026
@Licaa21
Licaa21 deleted the fix/av1-fmp4-fallback branch October 6, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Feature Request New feature or request Tizen

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant