radek-k / FFMediaToolkit

FFMediaToolkit is a cross-platform video decoder/encoder library for .NET that uses FFmpeg native libraries. It supports video frames extraction, reading stream metadata and creating videos from bitmaps in any format supported by FFmpeg.
MIT License
352 stars 56 forks source link

Issue when iterating over all frames #63

Closed hey-red closed 3 years ago

hey-red commented 3 years ago

I noticed that iterating over some files doesn't work. Maybe it's problem with current frame reader implementation, that's not work for some files?

First video successfully extract first 8 frames and throw unknown exception(System.ExecutionEngineException).

https://user-images.githubusercontent.com/1738743/104822578-9aa60200-5854-11eb-9617-9e8c12e97a6c.mp4

Second video is works fine.

https://user-images.githubusercontent.com/1738743/104822571-79451600-5854-11eb-88cf-777575ef23ce.mp4

All files have same container and contains same video codec. We can take first code sample for testing.

UPD: A System.ExecutionEngineException randomly throws here

error

radek-k commented 3 years ago

Probably fixed it in the latest release v4.0.1 release. If the crash still occurs, you can try using the GetFrame method overload to write the bitmap directly to a Span<byte>.