问题描述
我正在使用FFmpeg.AutoGen解密视频并将帧另存为位图。代码使用的是dotnet内核,我希望它可以在Windows和Linux上正常工作。
代码类似于所提供的示例:https://github.com/Ruslan-B/FFmpeg.AutoGen/blob/db9bcd4b9dfad5d117ffd71fe1a2d073e96a3520/FFmpeg.AutoGen.Example/Program.cs
AVFrame convertedFrame = this.converter.Convert(frame);
Bitmap image = new Bitmap(convertedFrame.width,convertedFrame.height,convertedFrame.linesize[0],PixelFormat.Format24bppRgb,(IntPtr)convertedFrame.data[0]);
使用以下方法保存图像时:
image.Save($"returned-image-{DateTime.Now.Ticks}.png",ImageFormat.Bmp);
该图像在Windows上看起来不错,但在Linux上已损坏。
解决方法
我会尝试使用不同版本的FFmpeg库。还要检查FFmpeg.Autogen的最新开放问题。