Many DVD players have the DivX logo on their front:

This means that you will be fine using a MPEG-4 Part 2 codec. MPEG-4 Part 2 videos can be found in AVI files. AVI containers are really old and considered legacy, but this is the only reason they will play on most devices.
Thus, if you use any of these encoders, creating an AVI file, you should be fine.
As libavcodec is free and open source, it is implemented in many applications. You can therefore use the following software for creating MPEG-4 AVI videos:
- SUPER© (download link at the bottom)
- Format Factory (looks weird, but it's okay)
- Handbrake (has unfortunately dropped AVI support, so your mileage may vary)
Again, I'd like to stress that libavcodec is free. Therefore, don't pay for software to encode videos unless you really need to.