jelum 36 Posted July 9, 2024 Posted July 9, 2024 How can I get video duration executing internal (from the mediabrowser.server.core nuget) interfaces? To run ffmpeg I use IFfmpegManager, but I didn't find a manager for ffprobe (the most obvious solution).
Solution jelum 36 Posted July 9, 2024 Author Solution Posted July 9, 2024 found var durationSec = (await _mediaProbeManager.GetMediaInfo(new MediaInfoRequest() { MediaType = DlnaProfileType.Video, ExtractChapters = false, MediaSource = new MediaSourceInfo() { Protocol = MediaProtocol.File, Path = filePath, Type = MediaSourceType.Default, IsRemote = false } }, cancellationToken) ).RunTimeTicks / 10_000_000;
Luke 42077 Posted July 11, 2024 Posted July 11, 2024 Hi, what is filePath from? This code will run ffprobe. If you already have an item from the server database then you should just use the database value and avoid probing the media file directly.
jelum 36 Posted July 11, 2024 Author Posted July 11, 2024 I'm adding a source for a new stream in the channel, but I want to add files shorter than X min only. The source is not in the system yet.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now