private Task ConvertStream(HttpContent httpContent, Stream outputStream)
{
Task convertTask = new Task(() => {
var convertSettings = new ConvertSettings {
CustomOutputArgs = "-map 0",
CustomInputArgs = "-vcodec h264"
};
var ffMpeg = new FFMpegConverter();
ffMpeg.ConvertProgress += FfMpeg_ConvertProgress;
ffMpeg.LogReceived += FfMpeg_LogReceived;
//var task = ffMpeg.ConvertLiveMedia(Format.h264, "C:\\Work\\Test\\converted.avi", Format.avi, convertSettings);
var task = ffMpeg.ConvertLiveMedia(Format.h264, outputStream, Format.mpeg, convertSettings);
task.Start();
var ffmpegStream = new FFMPegStream(task);
var copyTask = httpContent.CopyToAsync(ffmpegStream);
copyTask.Wait();
ffmpegStream.Close();
task.Wait();
// ffMpeg.ConvertMedia(@"C:\Work\Test\MyHomeSecureNode\devices\test\video.h264", "C:\\Work\\Test\\converted.avi", Format.avi);
outputStream.Close();
});
convertTask.Start();
return convertTask;
}