public string GetInfo(ExtractorInfoType type) { var process = FFprobe.GetProcess(); switch (type) { case ExtractorInfoType.AudioCodec: process.StartInfo.Arguments = GetStartArgument(FFprobeParameter.AudioCodec); break; case ExtractorInfoType.VideoCodec: process.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoCodec); break; case ExtractorInfoType.Bitrate: process.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoBitrate); break; case ExtractorInfoType.Dimension: process.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoDimension); break; case ExtractorInfoType.Duration: process.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoDuration); break; case ExtractorInfoType.Framerate: process.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoFramerate); break; } var data = GetProcessOutput(process); return(data); }
public string GetAudioCodec() { var process = FFprobe.GetProcess(); process.StartInfo.Arguments = GetStartArgument(FFprobeParameter.AudioCodec); var codec = GetProcessOutput(process); return(codec); }
public string GetVideoDimension() { var ffprobeProcess = FFprobe.GetProcess(); ffprobeProcess.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoDimension); var dimension = GetProcessOutput(ffprobeProcess); return(dimension); }
public TimeSpan GetVideoDuration() { var process = FFprobe.GetProcess(); process.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoDuration); var output = GetProcessOutput(process); var duration = ConvertToTimeSpan(output); return(duration); }
public double GetVideoFramerate() { var process = FFprobe.GetProcess(); process.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoFramerate); var output = GetProcessOutput(process); var framerate = ConvertToDouble(output); return(framerate); }
public MetadataInfo GetVideoMetaDataInfo() { var process = FFprobe.GetProcess(); process.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoMetaData); var output = GetProcessOutput(process); var audioCodec = GetAudioCodec(); var metaData = GetMetaDataFromOutput(output, audioCodec); return(metaData); }
public async Task <string> GetAudioCodecAsync() { var ffprobeProcess = FFprobe.GetProcess(); ffprobeProcess.StartInfo.Arguments = GetStartArgument(FFprobeParameter.AudioCodec); var codec = await Task.Run(async() => { var output = await GetProcessOutputAsync(ffprobeProcess); return(output); }); return(codec); }
public async Task <string> GetVideoDimensionAsync() { var ffprobeProcess = FFprobe.GetProcess(); ffprobeProcess.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoDimension); var dimension = await Task.Run(async() => { var output = await GetProcessOutputAsync(ffprobeProcess); return(output); }); return(dimension); }
public async Task <TimeSpan> GetVideoDurationAsync() { var ffprobeProcess = FFprobe.GetProcess(); ffprobeProcess.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoDuration); var duration = await Task.Run(async() => { var output = await GetProcessOutputAsync(ffprobeProcess); var data = ConvertToTimeSpan(output); return(data); }); return(duration); }
public async Task <double> GetVideoFramerateAsync() { var ffprobeProcess = FFprobe.GetProcess(); ffprobeProcess.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoFramerate); var framerate = await Task.Run(async() => { var output = await GetProcessOutputAsync(ffprobeProcess); var data = ConvertToDouble(output); return(data); }); return(framerate); }
public async Task <MetadataInfo> GetVideoMetaDataInfoAsync() { var process = FFprobe.GetProcess(); process.StartInfo.Arguments = GetStartArgument(FFprobeParameter.VideoMetaData); var dataTask = Task.Run(async() => { var output = await GetProcessOutputAsync(process); return(output); }); var audioCodecTask = GetAudioCodecAsync(); var data = await Task.WhenAll(dataTask, audioCodecTask); var metaData = GetMetaDataFromOutput(data[0], data[1]); return(metaData); }