diff --git a/renderer/VideoInfo/VideoInfo.js b/renderer/VideoInfo/VideoInfo.js index 39c628d..0473e32 100644 --- a/renderer/VideoInfo/VideoInfo.js +++ b/renderer/VideoInfo/VideoInfo.js @@ -15,6 +15,12 @@ const FileInput = require('../FileInput/FileInput.js'); css('../styles/tab-panel.css'); css('./VideoInfo.css'); +const fps = value => { + return /^[0-9]{1,}\/[0-9]{1,}$/.test(value) ? + +eval(value).toFixed(2) : + 'unknown'; +}; + function VideoInfo() { const metadata = useSignal([]); @@ -58,8 +64,8 @@ function VideoInfo() { const seconds = get(file, 'video.duration', 0); const duration = prettyMs(Number(seconds) * 1000); - const videoSummary = `${video.codec_name} (${video.width}x${video.height})`; - const audioSummary = `${audio.codec_name} (${audio.channels} channels)`; + const videoSummary = video ? `${video.codec_name} (${video.width}x${video.height}) (${fps(video.r_frame_rate)} fps)` : 'N/A'; + const audioSummary = audio ? `${audio.codec_name} (${audio.channels} channels)` : 'N/A'; // this object sets the order of the UI // yes, I know order is technically not guaranteed, but it works