1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add 'how many times' is the speed of transcoding in Playback Info (#5753)

* feat: new display value for transcoding fps

* fix: undefined safety + || instead of ??

* forgot to add to contributors

* fix: apply suggestions

* chore: remove from contrib to rebase

* chore: add to contrib again

---------

Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
Francisco Zorat 2024-08-15 15:28:57 -03:00 committed by GitHub
parent 1172d9a2b9
commit e4a6a2d6bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View file

@ -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

View file

@ -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) {
@ -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';