fix ffmpeg compatibility
FFmpeg: try to encode/decode using multiple threads (only works with a few codecs)
implement encoding using avcodec_encode_video2 (disabled and untested for now)