Low conversion quality using ffmpeg
Lossy codecs such as x264 degrade the image quality by design, if you don't want to lose image quality you either have to use a lossless codec or better yet, not re-encode at all.

I assume the source material is either H.264 or MPEG-2, so the best solution in your case would be to simply copy all the streams into the new container:

ffmpeg -i input.flv -c copy output.mp4


Here's the command for using x264's lossless mode if you have to re-encode for whatever reason:

ffmpeg -i input.flv -c:a copy -c:v libx264 -crf 0 output.mp4