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

"Playback Info"-Widget does not show full information about framerate. #6198

Open
marissa999 opened this issue Oct 14, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@marissa999
Copy link

marissa999 commented Oct 14, 2024

Describe The Bug
After digging into the code for some other reason (I considered adding the original framerate of the movie file to the widget) I realised, that getDisplayTranscodeFps is actually supposed to provide you a number of how many transcodings it could currently support (at least I think that is what the number is for). However I can not see that number in Jellyfin-Web (see last screenshot)

function getDisplayTranscodeFps(session, player) {
const mediaSource = playbackManager.currentMediaSource(player) || {};
const videoStream = (mediaSource.MediaStreams || []).find((s) => s.Type === 'Video') || {};
const originalFramerate = videoStream.AverageFrameRate;
const transcodeFramerate = session.TranscodingInfo.Framerate;
if (!originalFramerate) {
return `${transcodeFramerate} fps`;
}
return `${transcodeFramerate} fps (${(transcodeFramerate / originalFramerate).toFixed(2)}x)`;
}

The "full" information about how much faster/how many transcodings the server could support is only returned, if originalFramerate is defined. I could not figure out looking at the code in both jellyfin-web and jellyfin-server how videoStream.AverageFrameRate is actually determined. (Idea: Maybe the jellyfin-server could always set the AverageFrameRate to the OriginalFrameRate if the AverageFrameRate can not be determined?)

It seems like a different part of the code of the webui uses stream.AverageFrameRate || stream.RealFrameRate for getting the FrameRate.

if ((stream.AverageFrameRate || stream.RealFrameRate) && stream.Type === 'Video') {
attributes.push(createAttribute(globalize.translate('MediaInfoFramerate'), (stream.AverageFrameRate || stream.RealFrameRate)));
}

Potential Fix

I would assume the code in the file playerstats.js L203 would have to be changed from

const originalFramerate = videoStream.AverageFrameRate;

to

    const originalFramerate = videoStream.AverageFrameRate || videoStream.RealFrameRate;

After changing this locally and rebuilding jellyfin-web, I was able to get the output to work as expected:
image

I made a PR, in case the change i suggest is correct: #6199

(I also believe that maybe it might be useful in general to add the framerate as its own line/information to

function getMediaSourceStats(session, player) {

Steps To Reproduce

  1. Go to a video file, and click "Media Info"
  2. The Framerate appears, as expected
  3. Start watching that video file
  4. (Potentially) Change quality to force transcoding
  5. Open the "Playback Info"-Widget
  6. Transcoding Framerate does not show how many streams it could support

Expected Behavior
In Step 5 in Transcoding Framerate you should see something like 200 FPS (8.33)

Screenshots
image

System (please complete the following information):

  • Platform: Linux
  • Browser: Firefox
  • Server version: 10.9.11
  • Web version: 10.9.11
  • Build version: Release
@marissa999 marissa999 added the bug Something isn't working label Oct 14, 2024
marissa999 added a commit to marissa999/jellyfin-web that referenced this issue Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant