-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 option to always burn in subtitles if transcoding is triggered #5906
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
c863530
to
331934e
Compare
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
46ea5f5
to
0dbd659
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes requested below are not necessary - it works as is.
The logic is now reworked to reflect the transcoding behavior more accurately. Now depends on server PR #12676 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick look.
I was also thinking that if we could get the current (sub)stream URL, we could get the "delivery mode" from there. But I'm not sure we can get such information from a native player.
Not going to work because there will be no change to that because the transcoding pipeline checking for copy codec happens way after that |
Doing this in the |
The transcoding pipeline needs to perform some sort of fallback due to reasons like encoders being unavailable iirc so we always have ambiguity because the actual codec also depends on the server configuration inside and outside jellyfin. |
If we are not going to support changing the server configuration on the fly (during playback), we can "perform some sort of fallback due to reasons like encoders being unavailable" in the Moreover, we can (should) probably account for "encoders being unavailable" in the PlaybackInfo endpoint. |
In addition to Session promise refactoring:
jellyfin-web/src/components/playback/playbackmanager.js Lines 420 to 422 in e4c20df
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried changing subtitles during playback (SRT -> ASS (burn) -> SRT). On the second change, it disables subtitles. Burn when transcoding is disabled.
It requests a session too early because PlaybackManager sets the subtitles right away.
player.setSubtitleStreamIndex(selectedTrackElementIndex); |
changeStream
(video element/hls.js) doesn't have enough time to update the session on the server.
We could delay changing subtitles in the player and call setSubtitleStreamIndex
in onStartedAndNavigatedToOsd
(it's already there).
Then nothing should be requested, why it behaves differently? |
I really cannot reproduce this behavior with current implementation. Nothing is requested when you turned that option off so even if you set it right away it should not disable the srt subtitle. |
At first I tested with this feature enabled, and the session was requested before the player changed the video. There may be something wrong with this code and jellyfin-web/src/plugins/htmlVideoPlayer/plugin.js Lines 486 to 499 in 23ee5e6
|
Btw, we hide it, so it can be enabled but hidden. |
No, if you select the subtitle again you can show it. You disabled that option, nothing will be hidden |
I can confirm what you found is not related to this change. You can even reproduce the index reverted to -1 behavior on current master. It still looks like some kind of racing issue, but not related to session. The subtitle is loaded on current video stream and then the video stream is reloaded because transcode -> remux change, and then the index is reset to -1 during this reload. |
I mean that |
WTF, that is so wrong. We need to always show that. |
Wait, it does not hide? the one becomes hidden is the PGS one not the burn in one |
Oh, sorry - false alarm. I looked at the PGS one. 😅 |
} | ||
|
||
const player = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, arrow function saves the original this
by itself.
But using a helper variable with a meaningful name is clearer. 🤷♂️
Co-authored-by: Dmitry Lyzo <[email protected]>
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
Quality Gate passedIssues Measures |
Cloudflare Pages deployment
|
Changes
Subtitles often have synchronization issues after video transcoding. This option allows the client to opt-in to always burn in all subtitles, preventing out-of-sync subtitles at the cost of transcoding performance.
This also fixed the helper text for subtitle burn in as that option itself will trigger transcoding.
Issues
Depends on jellyfin/jellyfin#12430