Can't stop video with CancellationToken when AddDesktopStream
SidArtem opened this issue · comments
I tried to init stream with
FFmpeg.Conversions.New()
.AddDesktopStream()
.SetOutput(output)
.Start(cts.Token);
Also i have
var cts = new CancellationTokenSource();
_ = Task.Run(async () =>
{
await Task.Delay(5000);
cts.Cancel();
});
After that i got System.OperationCanceledException and my video is not saved in folder.
Hello @SidArtem
Have you tried to set SetInputTime on your conversion? Maybe it will be suitable for your case.
Anyway, I'm going to investigate what happened.
I don't need concrete time for that, my case requires "start\stop" recording "buttons" when it process some work.
You can look on #454
It's not ready and not completely tested but it works in your situation.
yes, it works. thank you 🤝
waiting for the next release =)