user16742: Basically, I want to convert an mp4 file that's in landscape to portrait.  It's a single image on a black background with no sound.  I want to keep the size and aspect ratio of the image intact and my plan is to convert it from 1280x720 to 720x1280.
I'm playing around with crop and padding, but I'm wondering if there's a way to get this done with one command, and if I need to reencode it.


user1871: For a target size of 720x1280, you would use
ffmpeg -i img.png -vf scale=-1:1280:flags=lanczos,crop=720:1280:(iw-720)/2:0 out.png


16742: <p>Basically, I want to convert an mp4 file that's in landscape to portrait.  It's a single image on a black background with no sound.  I want to keep the size and aspect ratio of the image intact and my plan is to convert it from 1280x720 to 720x1280.</p>

<p>I'm playing around with crop and padding, but I'm wondering if there's a way to get this done with one command, and if I need to reencode it.</p>

<p><a href="https://i.stack.imgur.com/dfTCS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dfTCS.png" alt="Here&#39;s a screenshot of the video"></a></p>
 1871: <p>For a target size of 720x1280, you would use</p>

<pre><code>ffmpeg -i img.png -vf scale=-1:1280:flags=lanczos,crop=720:1280:(iw-720)/2:0 out.png
</code></pre>
