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 'how many times' is the speed of transcoding in Playback Info #5753

Merged
merged 8 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
- [Chaitanya Shahare](https://github.com/Chaitanya-Shahare)
- [Venkat Karasani](https://github.com/venkat-karasani)
- [Connor Smith](https://github.com/ConnorS1110)
- [iFraan](https://github.com/iFraan)

## Emby Contributors

Expand Down
16 changes: 15 additions & 1 deletion src/components/playerstats/playerstats.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function getTranscodingStats(session, player, displayPlayMethod) {
if (session.TranscodingInfo.Framerate) {
sessionStats.push({
label: globalize.translate('LabelTranscodingFramerate'),
value: session.TranscodingInfo.Framerate + ' fps'
value: getDisplayTranscodeFps(session, player)
});
}
if (session.TranscodingInfo.TranscodeReasons?.length) {
Expand Down Expand Up @@ -191,6 +191,20 @@ function getDisplayBitrate(bitrate) {
}
}

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 / originalFramerate).toFixed(2)}x (${transcodeFramerate} fps)`;
}

function getReadableSize(size) {
if (size >= 1073741824) {
return parseFloat((size / 1073741824).toFixed(1)) + ' GiB';
Expand Down
Loading