Here’s how to reduce a MP4 video using H.265 format.
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4 |
I was able to reduce a video file from 550MB to 26MB without much quality loss.
cloud engineer
Here’s how to reduce a MP4 video using H.265 format.
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4 |
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
I was able to reduce a video file from 550MB to 26MB without much quality loss.
Here’s how to resize videos and pictures using FFMPEG.
Bulk Resize Pictures
for filename in *.JPG; do ffmpeg -i "$filename" -vf scale=-1:720 final/"$filename"; done |
for filename in *.JPG; do ffmpeg -i "$filename" -vf scale=-1:720 final/"$filename"; done
Bulk Resize Video and Create Thumbnail
for filename in *.MP4; do ffmpeg -i "$filename" -s 1080x720 -pix_fmt yuv420p -crf 18 "$filename".mp4; ffmpeg -ss 00:00:00 -i "$filename" -vframes 1 "$filename".jpg; done |
for filename in *.MP4; do ffmpeg -i "$filename" -s 1080x720 -pix_fmt yuv420p -crf 18 "$filename".mp4; ffmpeg -ss 00:00:00 -i "$filename" -vframes 1 "$filename".jpg; done
How to resize JPEG using FFMPEG.
ffmpeg -i TREE.JPG -y -vf scale=iw*.2:ih*.2 tree.jpg |
ffmpeg -i TREE.JPG -y -vf scale=iw*.2:ih*.2 tree.jpg
Another option is to set resolution.
ffmpeg -i TREE.JPG -y -vf scale=-1:720 tree.jpg |
ffmpeg -i TREE.JPG -y -vf scale=-1:720 tree.jpg
How to resize video using FFMPEG.
ffmpeg -i TREE.MP4 -s 640x360 -pix_fmt yuv420p -crf 18 tree.mp4 |
ffmpeg -i TREE.MP4 -s 640x360 -pix_fmt yuv420p -crf 18 tree.mp4
How to create a thumbnail from a video.
ffmpeg -ss 00:00:00 -i tree.mp4 -vframes 1 tree.jpg |
ffmpeg -ss 00:00:00 -i tree.mp4 -vframes 1 tree.jpg