How to make DivX-player-compatible DVDs with FFmpeg

How to encode files correctly so that your DivX-compatible DVD player can play them.