From 0127a3c6605d292d1e9b9fa53fdf159f98edfde7 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Thu, 29 Aug 2024 16:03:36 +0800 Subject: [PATCH 1/2] Show video rotation in mediainfo Signed-off-by: nyanmisaka --- src/components/itemMediaInfo/itemMediaInfo.js | 3 +++ src/strings/en-us.json | 1 + 2 files changed, 4 insertions(+) diff --git a/src/components/itemMediaInfo/itemMediaInfo.js b/src/components/itemMediaInfo/itemMediaInfo.js index 620578da8b..f77395abfc 100644 --- a/src/components/itemMediaInfo/itemMediaInfo.js +++ b/src/components/itemMediaInfo/itemMediaInfo.js @@ -194,6 +194,9 @@ function getMediaSourceHtml(user, item, version) { if (stream.RefFrames) { attributes.push(createAttribute(globalize.translate('MediaInfoRefFrames'), stream.RefFrames)); } + if (stream.Rotation && stream.Type === 'Video') { + attributes.push(createAttribute(globalize.translate('MediaInfoRotation'), stream.Rotation)); + } if (stream.NalLengthSize) { attributes.push(createAttribute('NAL', stream.NalLengthSize)); } diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 5d09fc16ce..04516e847c 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -1028,6 +1028,7 @@ "MediaInfoProfile": "Profile", "MediaInfoRefFrames": "Ref frames", "MediaInfoResolution": "Resolution", + "MediaInfoRotation": "Rotation", "MediaInfoSampleRate": "Sample rate", "MediaInfoSize": "Size", "MediaInfoTimestamp": "Timestamp", From 00876950d1396413385fd5f7e192cd99dfc98784 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Thu, 29 Aug 2024 16:08:34 +0800 Subject: [PATCH 2/2] Adjust the order of transcoding fps and speed ratio This item corresponds to `TranscodingInfo.Framerate`, so put speed ratio at the end. Signed-off-by: nyanmisaka --- src/components/playerstats/playerstats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/playerstats/playerstats.js b/src/components/playerstats/playerstats.js index 39fd66dc54..8d7d162c7d 100644 --- a/src/components/playerstats/playerstats.js +++ b/src/components/playerstats/playerstats.js @@ -202,7 +202,7 @@ function getDisplayTranscodeFps(session, player) { return `${transcodeFramerate} fps`; } - return `${(transcodeFramerate / originalFramerate).toFixed(2)}x (${transcodeFramerate} fps)`; + return `${transcodeFramerate} fps (${(transcodeFramerate / originalFramerate).toFixed(2)}x)`; } function getReadableSize(size) {