Fixed a few bugs that only showed up in ffmpeg 54.x, added support for avcodec_encode_video2, and fixed a memory leak in Muxer.