dot-imaging
dot-imaging copied to clipboard
VideoWriter - Video files with broken or missing index
Video files are generated with broken or missing index (VLC message), independently by the video codec. To isolate the problem the very basic sequence of calls is:
cameraCapture = new CameraCapture(1); String name = @"C:\Users\fidanken\Documents\dotImaging.avi"; VideoCodec videoCodec = new VideoCodec("UserSelection"); cameraCapture.Open(); go = true; await GoAsync();
private async Task GoAsync()
{
while (go)
{
frameIImage = await cameraCapture.ReadAsync(); //reads stream asynchronously
await videoWriter.WriteAsync(frameIImage);
}
}
go = false; videoWriter.Close(); videoWriter.Dispose();
It seems to me that somehow, when calling Close() and/or Dispose() (I tried multiple combinations), the files are not correctly closed.
Thank You for any help