/// <summary> /// finishes an ffmpeg process /// </summary> void CloseFileSegment() { muxer.Finish(); //ffmpeg.StandardInput.Close(); // how long should we wait here? ffmpeg.WaitForExit(20000); ffmpeg.Dispose(); ffmpeg = null; stderr = null; commandline = null; muxer = null; }
/// <summary> /// starts an ffmpeg process and sets up associated sockets /// </summary> private void OpenFileSegment() { try { _ffmpeg = new Process(); #if WINDOWS _ffmpeg.StartInfo.FileName = Path.Combine(PathManager.GetDllDirectory(), "ffmpeg.exe"); #else ffmpeg.StartInfo.FileName = "ffmpeg"; // expecting native version to be in path #endif string filename = $"{_baseName}_{_segment,4:D4}{_ext}"; _ffmpeg.StartInfo.Arguments = string.Format("-y -f nut -i - {1} \"{0}\"", filename, _token.Commandline); _ffmpeg.StartInfo.CreateNoWindow = true; // ffmpeg sends informative display to stderr, and nothing to stdout _ffmpeg.StartInfo.RedirectStandardError = true; _ffmpeg.StartInfo.RedirectStandardInput = true; _ffmpeg.StartInfo.UseShellExecute = false; _commandline = "ffmpeg " + _ffmpeg.StartInfo.Arguments; _ffmpeg.ErrorDataReceived += new DataReceivedEventHandler(StderrHandler); _stderr = new Queue <string>(Consolebuffer); _ffmpeg.Start(); } catch { _ffmpeg.Dispose(); _ffmpeg = null; throw; } _ffmpeg.BeginErrorReadLine(); _muxer = new NutMuxer(width, height, fpsnum, fpsden, sampleRate, channels, _ffmpeg.StandardInput.BaseStream); }
/// <summary> /// starts an ffmpeg process and sets up associated sockets /// </summary> void OpenFileSegment() { try { ffmpeg = new Process(); #if WINDOWS ffmpeg.StartInfo.FileName = System.IO.Path.Combine(PathManager.GetBasePathAbsolute(), "dll", "ffmpeg.exe"); #else ffmpeg.StartInfo.FileName = "ffmpeg"; // expecting native version to be in path #endif string filename = String.Format("{0}_{1,4:D4}{2}", baseName, segment, ext); ffmpeg.StartInfo.Arguments = String.Format("-y -f nut -i - {1} \"{0}\"", filename, token.commandline); ffmpeg.StartInfo.CreateNoWindow = true; // ffmpeg sends informative display to stderr, and nothing to stdout ffmpeg.StartInfo.RedirectStandardError = true; ffmpeg.StartInfo.RedirectStandardInput = true; ffmpeg.StartInfo.UseShellExecute = false; commandline = "ffmpeg " + ffmpeg.StartInfo.Arguments; ffmpeg.ErrorDataReceived += new DataReceivedEventHandler(StderrHandler); stderr = new Queue <string>(consolebuffer); ffmpeg.Start(); } catch { ffmpeg.Dispose(); ffmpeg = null; throw; } ffmpeg.BeginErrorReadLine(); muxer = new NutMuxer(width, height, fpsnum, fpsden, sampleRate, channels, ffmpeg.StandardInput.BaseStream); }
void endsegment() { current.Finish(); current = null; }
void startsegment() { var currentfile = System.IO.File.Open(String.Format("{0}_{1,4:D4}.nut", baseName, segment), System.IO.FileMode.Create, System.IO.FileAccess.Write); current = new NutMuxer(width, height, fpsnum, fpsden, sampleRate, channels, currentfile); }
private void EndSegment() { _current.Finish(); _current = null; }
private void StartSegment() { var currentFile = File.Open($"{_baseName}_{_segment,4:D4}.nut", FileMode.Create, FileAccess.Write); _current = new NutMuxer(_width, _height, _fpsNum, _fpsDen, _sampleRate, _channels, currentFile); }
private void endsegment() { _current.Finish(); _current = null; }
private void startsegment() { var currentfile = File.Open($"{_baseName}_{_segment,4:D4}.nut", FileMode.Create, FileAccess.Write); _current = new NutMuxer(width, height, fpsnum, fpsden, sampleRate, channels, currentfile); }