reticivis-net / mediaforge

A Discord bot for editing and creating videos, images, GIFs, and more!
GNU General Public License v3.0
82 stars 28 forks source link

Strange FFmpeg errors #147

Open reticivis-net opened 1 year ago

reticivis-net commented 1 year ago

FFmpeg seems to error out a lot of the time with strange errors that have no known fixes and are possibly ffmpeg bugs. These error messages include

reticivis-net commented 1 year ago

there is a strong possibility (see #149 #151 ) that the tenor gifs are causing these issues. re-encoding the tenor gif or encoding tenor mp4s as gifs could fix this.

WR4F commented 1 year ago

Interestingly, the issue is (at least for me) an intermittent one. The same tenor gifs are no longer causing a problem. @HexCodeFFF Did you update the bot recently with a fix or update the FFmpeg version?

As the errors suggest, some of these problems likely have to do with memory corruption and/or running out of memory.

My understanding of some of these errors:

reticivis-net commented 1 year ago

I didn’t update ffmpeg for a while and then I did very recently The errors are more prevalent cause the rewrite/v2 uses ffmpeg more heavily and more weirdly than before I’m just not sure what’s causing these errors. I’ll have to see if I can coax ffmpeg into throwing out a stack trace or something There’s also me using an in-memory file system inside the Linux docker that could maybe have issues? I’m not sure

reticivis-net commented 1 year ago

Several people have pointed to tenor gifs being the cause of these issues. Once I have the time I need to try to reliably reproduce one of these

reticivis-net commented 1 year ago

Ffmpeg has been updated to the latest version which is 6 I think and these errors are still occurring

reticivis-net commented 1 year ago

In my limited testing it seems that normal gifs, even gifs produced by MediaForge (ffmpeg) can cause this, but only gifs A possible workaround might be to convert to video, caption, then convert to gif

Jacherr commented 10 months ago

Most of these errors appear to be heap overflows and these kinds of issues can be caused by limited memory availability for the process.

Have you monitored memory usage while these commands are being executed? Is it possible that the process is running out of memory? This would especially be true if only being ran on gifs - especially Tenor ones, which are notoriously quite large files.

reticivis-net commented 10 months ago

Oh shit really? Memory on the host system is very limited and I’ve been using in memory tempfs to hopefully speed up things but I didn’t know it could cause this. I’ll turn off the in memory fs then damn thanks so much