Lowering the bitrate

Sunday, June 30, 2024 at 10:41 AM

Here is the part of my bash script that resizes the video.

$src is original big file
$dst is the new small file

It makes them 640 pixels wide.


IFS=x read width height rate < <(ffprobe -v error -select_streams v -show_entries stream=width,height,r_frame_rate -of csv=p=0:s=x "$src") width2=640 ((height2 = height * width2 / width)) ((height2 += height2 % 2)) if [ "$rate" = "60/1" ] then rate="30" fi ffmpeg -i "$src" -b:v 300k -b:a 80k -r "$rate" -filter:v scale="$width2:$height2" "$dst"

Name
Password

No need to register, just enter the same name and password every time.