user1696947
user1696947

Reputation: 159

How to convert video with ffmpeg with few almost static images

I have 8GB of video which have only 1 hour. I am trying to convert it to some format which reduce video size. Video contains few static images with dialogs in background. What is best way and format to convert it?

thanks a lot!

Upvotes: 0

Views: 558

Answers (1)

Teque5
Teque5

Reputation: 420

I would recommend a 2-pass variable bitrate video encoding. That way you only end up using bits when the video is dynamic. For the audio just use whatever bitrate you like with a modern codec. If you have ffmpeg installed, the following works:

First look at the file and decide how much compression you want to accomplish.

ffprobe infile.avi

You can either divide the bitrates you have by 10, or look here for a guide on bitrates. Now you are ready:

ffmpeg -y -i infile.avi -c:v libx264 -b:v 555k -pass 1 -c:a libmp3lame -b:a 128k -f mp4 /dev/null
ffmpeg -y -i infile.avi -c:v libx264 -b:v 555k -pass 2 -c:a libmp3lame -b:a 128k output.mp4

where the video and audio bitrates are 555 kb/s and 128 kb/s, respectively. Note that if your audio bitrate is already <= 256 kb/s, don't compress it any more unless you really have to. You can bypass the audio encoder by replacing -c:a libmp3lame -b:a 128k with -acodec copy.

Replace /dev/null with NUL if you are on a windows box (for the kids).

Upvotes: 1

Related Questions