You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The full error is "Exception thrown at 0x00007FFB719230C2 (swscale-5.dll) in GrayScaleFilter.exe: 0xC0000005: Access violation reading location 0x000001B5E690B000."
I'm using one function to export images into a folder. Another to build a video from them.
my code:
private static void CombineImagesUsingFFMTK(string fileLocation, int frameCount)
{
File.Delete(outputPath);
System.IO.DirectoryInfo directory = new DirectoryInfo(outputImageDir);
FFMediaToolkit.Decoding.MediaFile mediaFile = FFMediaToolkit.Decoding.MediaFile.Open(fileLocation);
// You can set there codec, bitrate, frame rate and many other options.
var settings = new VideoEncoderSettings(width: mediaFile.Video.Info.FrameSize.Width, height: mediaFile.Video.Info.FrameSize.Height, framerate: 30, codec: VideoCodec.H264);
settings.EncoderPreset = EncoderPreset.Fast;
settings.CRF = 17;
using (var video = MediaBuilder.CreateContainer(outputPath).WithVideo(settings).Create())
{
for (int i = 0; i < frameCount; i++)
{
Bitmap bitmap = new Bitmap($"{outputImageDir}\\{i}.jpeg");
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(System.Drawing.Point.Empty, bitmap.Size);
BitmapData bitLock = bitmap.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
FFMediaToolkit.Graphics.ImageData bitmapImageData = FFMediaToolkit.Graphics.ImageData.FromPointer(bitLock.Scan0, ImagePixelFormat.Bgr24, bitmap.Size);
Console.WriteLine($"Adding: image {outputImageDir}\\{i}.jpeg to video");
video.Video.AddFrame(bitmapImageData);
bitmap.UnlockBits(bitLock);
}
}
}
The error happens on line video.Video.AddFrame(bitmapImageData);
I looked into other issues, with similar problems (write protected, access violation) and modified from the example code into this. Not sure what to do.
Tried using different libraries to decode the video but this one feels like the most Intuitive. I had a version (Using Splicer) where I get the video, but I can't use the timeline to skip video and it runs on 1fps, 73frames (2,3sec video) becomes 73sec video.
The text was updated successfully, but these errors were encountered:
The full error is "Exception thrown at 0x00007FFB719230C2 (swscale-5.dll) in GrayScaleFilter.exe: 0xC0000005: Access violation reading location 0x000001B5E690B000."
I'm using one function to export images into a folder. Another to build a video from them.
my code:
The error happens on line
video.Video.AddFrame(bitmapImageData);
I looked into other issues, with similar problems (write protected, access violation) and modified from the example code into this. Not sure what to do.
Tried using different libraries to decode the video but this one feels like the most Intuitive. I had a version (Using Splicer) where I get the video, but I can't use the timeline to skip video and it runs on 1fps, 73frames (2,3sec video) becomes 73sec video.
The text was updated successfully, but these errors were encountered: