I try convert audio/video tracks to AAC format using qaac lib. In CMD it works and output information about progress of convertation. In my C# app it works too, but I can't get information about progress, i try use these events: OutputDataReceived, ErrorDataReceived. In handler of ErrorDataReceived I don't get needed information, in handler of OutputDataReceived I get received.Data like null value. How can I get conversion progress information during conversion in C# code?
(I use qaac lib because ffmpeg lib convert tracks to AAC incorrect - incorrect duration of result track, resolving not find for this problem, some analog apps have the same bug.)
Also i call these methods for process:
Handlers:
(I use qaac lib because ffmpeg lib convert tracks to AAC incorrect - incorrect duration of result track, resolving not find for this problem, some analog apps have the same bug.)
Creating process for converting.:
string arguments = $"\"{engineParameters.InputFile.Filename}\" -no-delay -o \"{engineParameters.OutputFile.Filename}\"";
processStartInfo = new ProcessStartInfo
{
FileName = QaacFilePath,
Arguments = arguments,
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden
};
Also i call these methods for process:
C#:
BeginOutputReadLine();
BeginErrorReadLine();
WaitForExit();
Handlers:
C#:
this.Process.OutputDataReceived += (sender, received) =>
{
if (received.Data == null) return;
//Some code...
}
C#:
this.Process.ErrorDataReceived += (sender, received) =>
{
if (received.Data == null) return;
//Some code...
}
Last edited: