public void GetInfo(string ffmpegexe, string workdir) { // File exists? if (!File.Exists(Info.FileName)) { Info.ErrorText = "File not found."; return; } // OK let's try SendDebugMessage("MediaInfoGrabber: Setting up prober..."); FFMPGProber prober = new FFMPGProber(); string strTempDirName = "probe_results"; string OutputBasePath = Path.Combine(ProbeResultsFolderPath, strTempDirName); prober.DebugMessage += new EventHandler <GenericEventArgs <string> >(prober_DebugMessage); bool result = prober.Probe(ffmpegexe, workdir, PathToToolkit, Info.FileName, OutputBasePath); prober.DebugMessage -= new EventHandler <GenericEventArgs <string> >(prober_DebugMessage); Info.NewLiveTVPartDuration = prober.duration; if (!result) { Info.ErrorText = "FFProber Failed"; return; } Info.Streams = prober.AVAudioAndVideoStreams; Info.Success = true; }
string GetProbeMapArguments(int preferredAudioStreamIndex) { FFMPGProber prober = new FFMPGProber(); bool result = prober.Probe("ffmpeglatest.exe", "", PathToTools, Request.InputFile, WorkingDirectory, preferredAudioStreamIndex); if (!result) { return(""); } return(prober.mapArguments.ToString()); }
public List <AVStream> ProbeFile(string fileName) { FFMPGProber prober = new FFMPGProber(); string strTempDirName = "probe_results"; string OutputBasePath = Path.Combine(Functions.StreamBaseFolder, strTempDirName); prober.DebugMessage += new EventHandler <FatAttitude.GenericEventArgs <string> >(prober_DebugMessage); bool result = prober.Probe(Functions.ToolkitFolder, fileName, OutputBasePath); prober.DebugMessage -= new EventHandler <FatAttitude.GenericEventArgs <string> >(prober_DebugMessage); if (!result) { return(new List <AVStream>()); } return(prober.AVAudioAndVideoStreams); }
public void GetInfo2(string ffmpegexe, string workdir) { // File exists? while (!File.Exists(Info.FileName)) { } // OK let's try bool result = false; SendDebugMessage("MediaInfoGrabber: Setting up prober..."); FFMPGProber prober = new FFMPGProber(); DateTime start = DateTime.Now; do { string strTempDirName = "probe_results"; string OutputBasePath = Path.Combine(ProbeResultsFolderPath, strTempDirName); prober.DebugMessage += new EventHandler <GenericEventArgs <string> >(prober_DebugMessage); result = prober.Probe(ffmpegexe, workdir, PathToToolkit, Info.FileName, OutputBasePath); prober.DebugMessage -= new EventHandler <GenericEventArgs <string> >(prober_DebugMessage); Info.NewLiveTVPartDuration = prober.duration; if (DateTime.Now.Ticks < (start.Ticks + 10000000 * 20)) // May take a small while, timeout after 20 seconds { //Debug.Print("Probing failed, trying again"); } else { break; } } while (!result); if (!result) { Info.ErrorText = "FFProber Failed"; return; } Info.Streams = prober.AVAudioAndVideoStreams; Info.Success = true; }
string GetProbeMapArguments(int preferredAudioStreamIndex) { FFMPGProber prober = new FFMPGProber(); bool result = prober.Probe("ffmpeg.exe","",PathToTools, Request.InputFile, WorkingDirectory, preferredAudioStreamIndex); if (!result) return ""; return prober.mapArguments.ToString(); }