MPEG-4 Part 2 video
When encoding to MPEG-4 Part 2 video using the encoders mpeg4
or libxvid
use -qscale:v
(or the alias -q:v
).
ffmpeg -i input -c:v libxvid -qscale:v 2 -c:a libmp3lame -ac 2 -q:a 4 output.avi
Adjust
-qscale:v
for video quality and-q:a
(similar tolame -V
) for audio quality.A lower value is a higher quality for both options. You may not be able to tell the difference between the input and output with
-qscale:v 2
.
Also see:
H.264 & H.265/HEVC video
MPEG-4 Part 2 video is outdated. Using a more modern format will provide better quality at lower bitrates.
Simple example assuming your ffmpeg
has support for libx264/libx265 (it probably does):
ffmpeg -i input output.mp4
The above example will use the default setting which is the same as below:
ffmpeg -i input -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k output.mp4
- Avoid AVI if possible with these encoders.
- Use AAC instead of MP3.
Also see: