Use propper ffmpeg compatiblity instead of relying on deprecated functions
Add missing header to CMakeLists.txt