Open Khhs167 opened 11 months ago
I'd love to attach the video I've been using, but I am currently on limited and slow data.
After further investigation, it seems like TryGetFrame
(or possibly GetFrame
) is the root of the problem.
When using TryGetNextFrame
it seems like it suddenly works.
I'll do some more testing!
Even more investigation later, and these kinds of errors seem to be more random that I thought.
All of a sudden TryGetNextFrame
stopped working...
I wonder if it has something to do with threading?
The decoding thread shouldn't be ongoing though? Shouldn't that be invoked and then waited for?
It might be a threading issue, but I'm not sure. Did you test other video files? What decoding thread do you mean? Is the Video.Step
method called from another thread? FFMediaToolkit isn't thread-safe, so make sure that the TryGetFrame
isn't called on different threads at the same time. You can try wrapping it with lock
statement to ensure that.
I am calling TryGetFrame from the same thread I do all FFmpeg stuff. I managed to get ogv to work smoothly, mp4 and mov had their own issues(mp4 was "reiniting context", mov I don't remember, but it was 2.4 GB which I ain't dealin' with).
I didn't try other webm's but I tried re-encoding etc.
Hello!
I am currently working on a system to allow me to integrate video support in my lil' game engine, and I decided to use FFMediaToolkit for decoding, since it seemed to fit my purposes.
Now, decoding works fine and dandy(some exceptions, which are most likely due to my own jank), for a couple seconds. Sometimes, it's 1 second, sometimes it's 6 seconds, and I don't know why.
The error log I've been getting(if you ignore the ALERROR, I've messed up some deinitialization stuff for OpenAL)
I can also attach Video.cs, and I hope it is understandable! Video.cs.txt
If any further info is needed, feel free to contact me.
I'm using the latest FFMPEG binaries available in that repo you've got linked in the README(the version given by FFmpegLoader.FFmpegVersion is
N-111626-g0ba719f726-20230726
so idk)