You are having several issues and you already solved flv does not support that sample rate
by including -ar
. It took me several comments for clarification, but your other issue, if I understand you correctly, is that the output is still too big in file size.
You mentioned FFmpeg: The ultimate Video and Audio Manipulation Tool which explains:
The CRF can be anything within 0 and 51, with the reasonable range being 17 to 23. The lower, the better the quality, the higher the file size. In general, the best bet is to just try and see for yourself what looks good. Take into account the result file size you want and how much quality you can trade in for smaller file sizes. It’s all up to you.
What that means is that you need to choose the highest CRF value that still gives you the quality you want. So instead of 19, which is very high quality, try a higher value. That doesn't mean you have to encode the whole video to get a general idea of what a particular crf value will look like. Use the -ss
and -t
options to select random sections to encode. This example will skip the first 2 minutes and 30 seconds and encode a 10 second clip:
ffmpeg -ss 00:02:30 -i input -t 30 -c:v libx264 -preset medium -crf 24 output.mp4
As shown in the example -ss
and -t
can accept either hours:minutes:seconds or just seconds.
Choosing to use crf means that you want your outputs to have a certain quality and file size is less of a concern. If the opposite is true, that you want your output to be a certain file size and quality is less of a concern then you need to use two-pass bitrate mode instead of crf. You can't easily know what the file size will be with crf, but a two-pass encode with -b:v
can approximately let you choose the file size in advance. In this example the desired output is 100 MB and the input is 671 seconds in duration (see the link for the math) so the command will be:
ffmpeg -i input -c:v libx264 -preset medium -b:v 1092k -pass 1 -an -f mp4 -y NUL
ffmpeg -i input -c:v libx264 -preset medium -b:v 1092k -pass 2 -c:a libfaac -b:a 128k output.mp4
Personally, I rarely use a two-pass encode because I prefer my set of videos to be a similar quality (and therefore varying file sizes which I care less about).
As for the -3 (the current stackoverflow question rating), I assume readers thought your question was unclear since you did not explain "without success" so nobody knew what the actual problem was. Be direct, descriptive, and provide all useful information: especially the commands and console outputs with your next FFmpeg question and you will get better and faster answers.