The question is partially answered by the other comments. I have just few details to had :
As it's the compatibility that matter you have a question of target player to answer :
- to be compatible with older player, the most widespread container is AVI. It's the lightest to decode and I never found a player without this format
- to be compatible with all the recent players, there is no alternative to mp4, but beware only the mpeg-2 and h264 compression are widespread
- to be compatible with all future players : the mkv is the way, as it can expose multiple stream with alternative codec for audio and video (mp3 + aac + av1 + h264 in the same file) allow the player to open the one it can read
Now you can choose !