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:
parent
1172d9a2b9
commit
e4a6a2d6bc
2 changed files with 16 additions and 1 deletions
|
@ -91,6 +91,7 @@
|
||||||
- [Chaitanya Shahare](https://github.com/Chaitanya-Shahare)
|
- [Chaitanya Shahare](https://github.com/Chaitanya-Shahare)
|
||||||
- [Venkat Karasani](https://github.com/venkat-karasani)
|
- [Venkat Karasani](https://github.com/venkat-karasani)
|
||||||
- [Connor Smith](https://github.com/ConnorS1110)
|
- [Connor Smith](https://github.com/ConnorS1110)
|
||||||
|
- [iFraan](https://github.com/iFraan)
|
||||||
|
|
||||||
## Emby Contributors
|
## Emby Contributors
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ function getTranscodingStats(session, player, displayPlayMethod) {
|
||||||
if (session.TranscodingInfo.Framerate) {
|
if (session.TranscodingInfo.Framerate) {
|
||||||
sessionStats.push({
|
sessionStats.push({
|
||||||
label: globalize.translate('LabelTranscodingFramerate'),
|
label: globalize.translate('LabelTranscodingFramerate'),
|
||||||
value: session.TranscodingInfo.Framerate + ' fps'
|
value: getDisplayTranscodeFps(session, player)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (session.TranscodingInfo.TranscodeReasons?.length) {
|
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) {
|
function getReadableSize(size) {
|
||||||
if (size >= 1073741824) {
|
if (size >= 1073741824) {
|
||||||
return parseFloat((size / 1073741824).toFixed(1)) + ' GiB';
|
return parseFloat((size / 1073741824).toFixed(1)) + ' GiB';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue