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

Fix stride calculation (again) #99

Closed IsaMorphic closed 2 years ago

IsaMorphic commented 2 years ago

Hello there. In light of #68, and my own issues with that specific fix, I have implemented the correct stride calculation into the code. I believe the user that created the issue originally was mistaken.

radek-k commented 2 years ago

Unfortunately, both stride calculation methods are incorrect in some cases. Some libraries use stride rounded up to the nearest DWORD, but the others do not. I'm going to change the ImageData constructor, so that stride have to be passed by user.

IsaMorphic commented 2 years ago

Oh I see, that is quite unfortunate :( This seems like a good workaround though. 👍