mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2026-01-15 08:23:36 -03: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:
@@ -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
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user