I asked elsewhere, and eventually, I was given this solution:
Code:
ffmpeg -i input.avi -c:v libx264 -preset slow -crf 20 -c:a aac -b:a 160k -vf format=yuv420p -movflags +faststart output.mp4
This has worked brilliantly, and has produced fully functional, smaller and stable videos which look very neat. The person who helped me also provided details about the parameters, and I decided that I didn't need the -movflags and +faststart, at least for now.
EDIT: Forgot to mention, the parameters I had were more or less the same, but the crucial part was "-vf format=yuv420p" for MP4 compatibility.