Some fixes to make the program compile again with older versions of libav/ffmpeg, and added detection code to the prebuild script because ffmpeg and libav apparently don't always use the same version numbers.