Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize and change bitrate with ffmpeg

Tags:

ffmpeg

Noobish question here: I need to lower the quality of a video both by scaling it down and changing its bitrate (as an alternative to watermarking it for a client).

I have tried:

ffmpeg -i input_video.mp4 -vf scale=1200:600 -v:b 10M output_video.mp4

Of course, this is wrong. I guess there is another way to append the bitrate command.

Any help?

like image 616
Sergio Avatar asked Aug 02 '17 15:08

Sergio


People also ask

How do I change audio bitrate in FFmpeg?

Set Bitrate The most common way of compressing audio files is decreasing the bitrate of the file. To set the bitrate of an output file with FFMPEG, use the -ab flag. There are several common bitrates that are used for compression. You can use any number of them, depending on your goal.


1 Answers

Here you go:

ffmpeg -i input_video.mp4 -vf "scale=1200:600" -b:v 10M output_video.mp4

There were two mistakes here:

  • -v:b: the bitrate codec(b) and the stream selector(v for video) were swapped
  • -vf scale: the filter command should be placed between quotes (you can also use the regular scale option instead: -s 1200x600)
like image 54
Gergely Lukacsy Avatar answered Sep 28 '22 13:09

Gergely Lukacsy