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

Add fMP4 playback support (HEVC, AV1) in HLS.js #4762

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

nyanmisaka
Copy link
Member

@nyanmisaka nyanmisaka commented Aug 28, 2023

The recent HLS.js update seems to have resolved the fMP4 seeking issue. Let's first enable fMP4 on HLS.js.

Player/Feature TS fMP4 seek H.264 HEVC AV1 AAC MP3 AC3/EAC3 FLAC OPUS
Hls.js ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ (1.5.0) ✔️ (1.5.0)
Shaka ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️

Tested codecs:
video: h264, hevc, av1 (av1 in firefox require 1.5.0)
audio: mp3, aac, ac3, eac3 (flac and opus require 1.5.0)

Tested browsers:
Chrome, Firefox, Edge Chromium, Safari and their mobile versions

Changes

  • Add fMP4 playback support (HEVC, AV1) in HLS.js

Issues

- Fix fLaC and Opus playback
- Fix AV1 playback in Firefox
- Remove this when upstream 1.5.0 is tagged

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Tested codecs:
video: h264, hevc, av1 (av1 in firefox require 1.5.0)
audio: mp3, aac, ac3, eac3 (flac and opus require 1.5.0)

Tested browsers:
Chrome, Firefox, Edge Chromium, Safari and their mobile versions

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Sep 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@thornbill
Copy link
Member

Do you have a PR open upstream to hls.js with your changes?
This does not depend on the linked server PR right?

Thanks!

@nyanmisaka
Copy link
Member Author

nyanmisaka commented Sep 8, 2023

Do you have a PR open upstream to hls.js with your changes?

This does not depend on the linked server PR right?

Thanks!

My fixes are already in upstream but it seems they still have pending PRs before tagging the 1.5.x version.

video-dev/hls.js#5774

Server side AV1 PR is already merged few months ago.

@thornbill thornbill added feature New feature or request playback This PR or issue mainly concerns playback labels Sep 11, 2023
@thornbill thornbill added this to the v10.9.0 milestone Sep 11, 2023
@thornbill thornbill merged commit 1b72e82 into jellyfin:master Sep 11, 2023
19 checks passed
@nyanmisaka nyanmisaka deleted the hlsjs-fmp4 branch October 20, 2023 21:12
@Schaka
Copy link

Schaka commented Oct 20, 2023

Continuing from PR #4041.

Do you want me to just open a bug report? The same thing applies on master as is.
AC3 and EAC3 isn't getting played. When activating "Prefer fMP4-HLS Media Container", h264 is then transcoded to h265 if the sound triggers a transcode.

@nyanmisaka
Copy link
Member Author

@Schaka Which OS/client/browser are you using? Apart from the native HLS support on Apple devices, AC3 and EAC3 are only available on Edge on Windows.

@Schaka
Copy link

Schaka commented Oct 20, 2023

Win 11, tried both Edge (Chromium based) and Chrome.
In both scenarios, the sound leads to transcoding.

However, if the source is HEVC, only the sound gets transcoded correctly - the video source is the same and not transcoded.
If the source is h264 and HLS is activated in settings, everything gets transcoded. I think the browserProfiles for HLS might be missing h264 altogether.

Unfortunately I couldn't figure out if there's any code to retain the original encoding - only that the order of supplied codecs leads to a priority for transcoding.

HLS off - h264 AC3 content - Chrome & Edge => transcodes video to H264 and audio to AAC
HLS on - h264 AC3 content - Chrome & Edge => transcodes video to HEVC and audio to AAC

HLS off - h265 AC3 (DD5.1) - Chrome & Edge => transcodes video to h264, transcodes audio to AAC
HLS on - h265 AC3 (DD5.1) - Chrome & Edge => direct plays HEVC, transcodes audio to AAC

Edit: I've tried Chromium builds with AC3/EAC3 activated and they behavior is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request playback This PR or issue mainly concerns playback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants