i would like to use DGDemux in a c# Application.
i Use the following Code for some other Commandline Interfaces and normaly i get information from StandardOutput or by ffnpeg StandardError.
Code: Select all
using(Process process = new Process())
{
process.StartInfo.FileName = dgDemuxerFilePath;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.Arguments = command; //"/S /C \"" + command + "\"";
process.OutputDataReceived += (s, e) =>
{
if (_newEventReportMethod != null)
{
_newEventReportMethod.Report(e.Data);
}
};
process.ErrorDataReceived += (s, e) =>
{
if (_stopWorking)
{
process.Kill(true);
}
redirectedErrorOutput = e.Data;
if (_newEventReportMethod != null)
{
_newEventReportMethod.Report(redirectedErrorOutput);
}
if (!string.IsNullOrEmpty(redirectedErrorOutput))
{
if (redirectedErrorOutput.ToLower().Contains("error while decoding") || redirectedErrorOutput.ToLower().Contains("broken pipe"))
{
hasError = true;
process.Kill(true);
}
}
};
try
{
process.Start();
process.BeginOutputReadLine();
process.BeginErrorReadLine();
process.WaitForExit();
}
catch (Exception ex)
{
//ex.Message;
}
}
Could you Please implement the OutputData that i get the Progress of the Demuxing process?
thx and regards
lastone