Use -trans_color option on gifv instead of mem hungry reverse filter
Use -trans_color option on gifv instead of mem hungry reverse filter

'reverse' complex filter has to buffer entire video content in memory
before next filter can chop off last frame. In case of long big gif
inputs, amount of memory could exceed few gigabytes. If thumbor server
at the same time tries to optimize 2 gifv files, it's likely to run out
of memory and be killed with OOM killer. When ffmpeg process killed,
optimizer throws exception, but due to the fact thumbor misuses futures,
exception is never retrieved, so request waits until timeout happens.
There is a high chance that many requests will hang at the same time,
effectively exhausting open files limit and rendering service
interruption.
Reverse filter needed to overcome issue with ffmpeg dropping last frame
duration when used with overlay filter, which, in turn, was used to add
color-background for input gifs with transparency.
Turns out, that ffmpeg's gif decoder can be supplied with -trans_color
parameter, which does exactly that, but on decoding stage. This allows
to remove memory-heavy reverse filter and overlay all together.
As a side effect, previously broken ffmpeg 3.3 should also work fine.

see https://github.com/thumbor/thumbor/pull/907

kkopachev/thumbor,gi11es/thumbor,okor/thumbor,marcelometal/thumbor,thumbor/thumbor,voxmedia/thumbor,scorphus/thumbor,thumbor/thumbor,kkopachev/thumbor,scorphus/thumbor,thumbor/thumbor,marcelometal/thumbor,scorphus/thumbor,gi11es/thumbor,voxmedia/thumbor,okor/thumbor,thumbor/thumbor,gi11es/thumbor,kkopachev/thumbor,voxmedia/thumbor,scorphus/thumbor,okor/thumbor,kkopachev/thumbor,marcelometal/thumbor