I want to send a couple of images to ffmpeg and output a video
I have tried to use something similar to this which always seems to finish but when I check the output, it always returns an empty 48b file
I have tried changing the order of the flags but nothing seems to work
Here is my code
using System.Diagnostics;
using SkiaSharp;
Process process = new Process();
process.StartInfo.FileName = @"ffmpeg";
process.StartInfo.Arguments = "-f image2pipe -r 30 -i - /home/user/Videos/test33.mp4";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.Start();
for (int i = 0; i < 300; i++)
{
using var ms = new MemoryStream();
SKImageInfo imageInfo = new SKImageInfo(1280, 720, SKColorType.Rgba8888);
using SKSurface surface = SKSurface.Create(imageInfo);
SKCanvas canvas = surface.Canvas;
canvas.Clear(SKColor.Parse("#ffffff"));
using SKImage image = surface.Snapshot();
using SKData data = image.Encode(SKEncodedImageFormat.Png, 80);
data.SaveTo(ms);
ms.WriteTo(process.StandardInput.BaseStream);
}