我正在使用c#中的process对象。
我也在使用FFMPEG。
我正在尝试从重定向的输出中读取字节。我知道这些数据是图像,但是当我使用以下代码时,我无法获得图像字节数组。
这是我的代码:
var process = new Process();
process.StartInfo.FileName = @"C:\bin\ffmpeg.exe";
process.StartInfo.Arguments = @" -i rtsp://admin:admin@192.168.0.8:554/video_1 -an -f image2 -s 360x240 -vframes 1 -";
process.StartInfo.CreateNoWindow = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.Start();
var output = process.StandardOutput.ReadToEnd();
byte[] bytes = Encoding.ASCII.GetBytes(output);
第一个字节不是jpeg的标头吗?