Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achmadfatoni/df7f555a6516b8997da070cded5db11b to your computer and use it in GitHub Desktop.
Save achmadfatoni/df7f555a6516b8997da070cded5db11b to your computer and use it in GitHub Desktop.
Resize/Scale/Change video resolution using ffmpeg

Check original video resolution

ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 filename-here.mp4

you will see file resolution like 1280x720

then resize to expected resolution:

 ffmpeg -i input-filename.mp4 -vf scale=640:480 640-480.mp4

input-filename.mp4 = original filename scale=640:480 = expected scale size 640x480 640-480.mp4 = output filename with new size/resolution

Source: https://ottverse.com/change-resolution-resize-scale-video-using-ffmpeg/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment