Use -q:v
to control (M)JPEG quality
The effective range is a linear scale of 2-31, and a lower value will result in a higher quality output.
Examples
Make MJPEG video in MOV container:
ffmpeg -i input.mov -c:v mjpeg -q:v 3 -an output.mov