private Size GetMediaSizeWithVlc(string path) { using (var vlc = new Vlc(VlcSettings.VlcOptions)) { using (var media = vlc.CreateMediaFromPath(path)) { media.Parse(); var tracks = media.GetTracks(); var video = tracks.FirstOrDefault(mt => mt.Type == TrackType.Video) as VideoTrack; return(video == null ? Size.Empty : new Size(video.Width, video.Height)); } } }
private bool HasVideoStream(string path, out Size size) { using (var vlc = new Vlc(VlcSettings.VlcOptions)) { using (var media = vlc.CreateMediaFromPath(path)) { media.Parse(); var tracks = media.GetTracks(); var video = tracks.FirstOrDefault(mt => mt.Type == TrackType.Video) as VideoTrack; size = video == null ? Size.Empty : new Size(video.Width, video.Height); return(video != null); } } }