From 00e931cd22eb823056e9ddfa8d84cc8ed5307c4e Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 6 Oct 2024 18:04:37 +0200 Subject: [PATCH] More info from ffmpeg --- src/libse/Common/FfmpegMediaInfo.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libse/Common/FfmpegMediaInfo.cs b/src/libse/Common/FfmpegMediaInfo.cs index 8bbab4e2d..7825e2de6 100644 --- a/src/libse/Common/FfmpegMediaInfo.cs +++ b/src/libse/Common/FfmpegMediaInfo.cs @@ -39,6 +39,11 @@ namespace Nikse.SubtitleEdit.Core.Common return ParseLog(log); } + public long GetTotalFrames() + { + return (long)((double)FramesRate * Duration.TotalMilliseconds / TimeCode.BaseUnit); + } + public bool HasFrontCenterAudio(int trackNumber) { if (trackNumber < 0) @@ -155,7 +160,7 @@ namespace Nikse.SubtitleEdit.Core.Common return sb.ToString(); } - public static Process GetFFmpegProcess(string inputFileName) + private static Process GetFFmpegProcess(string inputFileName) { var ffmpegLocation = Configuration.Settings.General.FFmpegLocation; if (!Configuration.IsRunningOnWindows && (string.IsNullOrEmpty(ffmpegLocation) || !File.Exists(ffmpegLocation)))