| | 58 | |
| | 59 | However, you can also achieve this with the force_original_aspect_ratio option. From the documentation: |
| | 60 | |
| | 61 | One useful instance of this option is that when you know a specific device's maximum allowed resolution, you can use this to limit the output video to that, while retaining the aspect ratio. For example, device A allows 1280x720 playback, and your video is 1920x800. Using this option (set it to decrease) and specifying 1280x720 to the command line makes the output 1280x533. |
| | 62 | |
| | 63 | This allows you to force the image to fit into a 320x240 box: |
| | 64 | |
| | 65 | {{{ |
| | 66 | ffmpeg -i input.jpg -vf scale=w=320:h=240:force_original_aspect_ratio=decrease output_320.png |
| | 67 | }}} |
| | 68 | |
| | 69 | This produces our 320x207 image that we had seen before: |
| | 70 | |
| | 71 | [[Image(output_320.png)]] |
| | 72 | |
| | 73 | |