Properly catch a bad allocation exception.

On MFC projects `CMemoryException` is thrown instead of the
STL's `std::bad_alloc` exception.
Use nullptr instead of casting 0 to pointer.
Add support for basic RTMP urls
Use internal filters for gif format.

Microsoft's Generate Still Video filter has problems with animation rate and store every
frame (uncompressed) in memory, which for gifs with longer animation can be a problem.

Fixes #4678, #4856