Reputation: 759
I try to decrease video resolution using ffmpeg by,
ffmpeg -y -hide_banner -loglevel panic -i "input.mp4" -vf "scale=-1:256" -q:v 1 -c:a copy -threads 1 "output.mp4"
But the video file size is increased. The original height is larger than 256. Why the file size is increased though the resolution is decreased?
Upvotes: 1
Views: 604
Reputation: 1
I had just some suggestions, but then I decided to test them out.
https://trac.ffmpeg.org/wiki/Encode/VP9
this page shows some methods to configure the quality.
I tried average, constant and constraint quality mode.
the video is 2.4 MB, after resize the 7.8 seconds long video file's sizes are around: 2.7MB, 4MB, 2.0MB; respectively.
this is how to use constraint quality:
ffmpeg -i input -crf 30 -b:v 2M output
or
ffmpeg -i input -minrate 500k -b:v 1000k -maxrate 2000k output
when using crf
, lower the value higher the file size and quality.
Upvotes: 0
Reputation: 31101
Because bitrate and resolution are independent variables. -q:v 1 basically means to use as many bits as necessary to keep the video nearly identical to the (scaled) input.
Upvotes: 1