On Debian 13 (and similarly Ubuntu/ArchLinux/..), FFmpeg 7 is being installed. Further, current FFmpeg developer version is 8. FFmpeg versions 4 and 5 are no more used in contemporary distributions, hence we can also remove these to save footprint.
Resolved as described. Only material code change: - drop using `avcodec_close` for just `avcodec_free_context`