video: Improve average framerate calculation.
Remove avcodec_get_frame_defaults().
Use av_frame_free() instead of deprecated avcodec_free_frame().