Closed redbaty closed 3 years ago
I know that the library performance isn't optimal, but I currently don't have many time to improve it. If you have any ideas, please open a pull request.
Yeah, this is more of a "where to look" kind of question, the question I'm gonna ask is kinda dumb, but I don't know FFmpeg too much, can you walk me through the frame grabbing process?
Example
//VideoStream.cs - Line 95
private unsafe ImageData Read()
{
stream.Read(frame); //This does blabla bla and send packet so that this does that.
FramePosition++; // Moves frame position.
var targetLayout = GetTargetSize(); //Calculate targetsize.
var bitmap = ImageData.CreatePooled(targetLayout, mediaOptions.VideoPixelFormat); // Rent memory space.
scaler.AVFrameToBitmap(frame, bitmap); // Do a thing.
return bitmap;
}
Are there any improvements to be made on the performance side? Currently
file.Video.ReadNextFrame();
is taking on average 22,33ms to run, which on a 24fps video isn't much faster than real-time ☹️Are there any options for making it faster?