Depending on the codecs used in your FLV you may be able to get away with simply re-wrapping it in an mp4 container. You'll need
MPEG4 simple profile video and
AAC audio. You can find out some info on your source file with
ffmpeg -i input.flv
I'm not sure whether simply having H.264/MPEG4 Simple + AAC is good enough or if there are specific options to the codecs that are supported. It's easy enough to test:
ffmpeg -i input.flv -c copy -copyts output.mp4
copy timestamps it will help audio sync.
If that doesn't work, try forcing audio and video codecs. This will re-encode the file:
ffmpeg -i input.flv -c:v libx264 -crf 23 -c:a libfaac -q:a 100 output.mp4
To improve the video quality, you can use a lower CRF value, e.g. anything down to 18. To get a smaller file, use a higher CRF, but note that this will degrade quality.
To improve the audio quality, use a higher quality value. For FAAC,
100 is default.
Here are a couple thoughts on the ffmpeg command suggested in the question.
-ar refers to the audio sample rate. I would recommend not messing with this until you understand things better. If you want to play with audio encoding, adjust the bitrate (e.g.,
-b:a 128k) and let the encoder choose what to do based on that.
If you do end up going down this road...
CD quality is 44100Hz sampling; typical video uses 48000Hz.
You may note that 22050 in the original question's example is 1/2 the cd quality sample rate. if you're downconverting CD material this is a good choice. If you're starting with 48KHz source (which you probably are; again, this is much more common than 44100 in video files) i'd use 24Khz instead. It probably won't matter much, but it may sound a little better and use a little less CPU to do the conversion.