lahapersonal.blogg.se

Ffmpeg resize video resolution
Ffmpeg resize video resolution






I tried running ffmpeg -i orig.mp4 -vf scale=1920:1080 smaller.mp4īut the result is very poor quality, with the entire image being composed of square "tiles" as if I was magnifying 4:1. You can make it faster by using fast or veryfast or slower with veryslow and placebo will make it ever so slightly better than veryslow at the expense of a lot more processing time (hence the name).īTW Don't use -c copy, that means just copy the video and audio streams without doing anything to them at all, so nothing you do in terms of scale, codec, bitrate etc will have any effect.I have some 4K 3840x2160 footage in MP4 format that I need to bring down to 1080p. Main profile is good for device compatibility, the slow preset for the libx264 encoder is a pretty good balance of speed and quality, so this is a good general web-encoding workhorse.

ffmpeg resize video resolution

So, a reasonably complete command would look like: ffmpeg -i input.mov -vf scale=720x406,setdar=16:9 -preset slow -profile:v main -crf 20 output.mov You may want to put additional commands for the codec and so on, eg -c:v libx264 to use the x264 mp4 encoder, and something like -crf 20 to set the constant rate factor to 20 (usually a pretty good compromise between size and quality). Filters can be quite complex, but in the most simple usage they take the form effect=parameter,nexteffect=anotherparameter, and they get processed in the order you write them.

ffmpeg resize video resolution

What I'm doing with the -vf command and the x=y,z=a expressions that follow is creating a chain of filters. So if you want to stretch the movie anamorphically to a new aspect ratio you need to manually set the pixel aspect ratio, called the SAR for "Sample Aspect Ratio", thus for square pixels use: ffmpeg -i input.mov -vf scale=720x406,setsar=1:1 output.mp4Īlternatively you can set the display aspect ratio to whatever you want, thus: ffmpeg -i input.mov -vf scale=720x406,setdar=16:9 output.mp4 Will create a movie with the required pixel dimensions, but if you look at the output you'll find that it adds information into the metadata so that it will play back at the same aspect ratio as the original, by using non-square pixels. ffmpeg -i input.mov -vf scale=720x406 output.mov Using the scale filter will do it, but there is a bit more to it.








Ffmpeg resize video resolution