![]() So you either save resized files under new names or into a new folder, and it becomes tedious. You probably already know that FFmpeg can resize images proportionally, and also that it can't overwrite them. ![]() ![]() If you don't want to bother with re-encoding, then any player worth using should allow you to do this upon playback. Resize multiple images proportionally with FFmpeg and a shell function. padįfmpeg -i input -vf "scale=-1:720,pad=1280:ih:(ow-iw)/2" outputĪ more generic command that will work for all input file aspect ratios will use force_original_aspect_ratio=1 as an option to scale: ffmpeg -i input -vf "scale=w=1280:h=720:force_original_aspect_ratio=1,pad=1280:720:(ow-iw)/2:(oh-ih)/2" outputįfmpeg -i input -vf "scale=1280:-1,crop=iw:720" outputĪ more generic command that will work for all input file aspect ratios will use force_original_aspect_ratio=2 as an option to scale: ffmpeg -i input -vf "scale=w=1280:h=720:force_original_aspect_ratio=2,crop=1280:720" output Take a look at these examples and the documentation for each filter. You have two main options to make it fit after using scale: pad or crop. To write / save images in OpenCV using a function cv2.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |