ffmpeg -i input.flv -c:v libx264 -c:a aac -strict -2 output.mp4
explain:
-i input.flv
: Specifies the input file.-c:v libx264
: The video codec uses the x264 library.-c:a aac
: The audio codec uses the AAC encoder.-strict -2
: Make sure the AAC encoder uses low-latency mode.output.mp4
: The name and format of the output file.
If you need to change the size or quality of the output file, you can use -b:v
the and -crf
flags. Here is an example:
ffmpeg -i input.flv -c:v libx264 -b:v 500k -crf 23 -c:a aac -strict -2 output.mp4
-b:v 500k
: The video bit rate is 500Kbps.-crf 23
: Video compression quality, 23 is medium quality. Higher numbers mean worse quality but smaller file size, lower numbers mean better quality but larger file size.