How do I resize video ffmpeg?
Scales to a target width while computing a height that stays even, which H.264 requires.
Scales to a target width while computing a height that stays even, which H.264 requires.
ffmpeg -i https://cdn.rendobar.com/assets/examples/sample.mp4 -vf scale=640:-2 -c:v libx264 -crf 23 -t 5 out.mp4job_ece789351fe7440d
Use -2, never -1. Both preserve the aspect ratio, but -2 rounds to an even number and -1 does not. H.264 with yuv420p needs both dimensions even, so -1 produces an encoder failure on roughly half of all source aspect ratios.
An odd width with -1 can compute an odd height, and libx264 refuses to encode odd dimensions.
ffmpeg -i https://cdn.rendobar.com/assets/examples/sample.mp4 -vf scale=641:-1 -c:v libx264 -crf 23 -t 5 out.mp4This one fails outright, which is the good case. You find out immediately.
job_ec395f0805e245a6
Scales to a target width while computing a height that stays even, which H.264 requires.
Use -2, never -1. Both preserve the aspect ratio, but -2 rounds to an even number and -1 does not. H.264 with yuv420p needs both dimensions even, so -1 produces an encoder failure on roughly half of all source aspect ratios.
We ran the naive version too. This one fails outright, which is the good case. You find out immediately.
Not with Rendobar. The command on this page ran through the API against a URL, with no local FFmpeg and no server. The job id below it is the job that produced these numbers.
This exact command ran through the API against a URL.