Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-23T18:40:00.887Z
Answers.Text: Thanks, It looks like it only added the padding on top of the video, but that might actually work better for my needs.
Answers.UserDisplayName: Smeegs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-23T18:36:18.467Z
Answers.LastActivityDate: 2016-09-23T18:36:18.467Z
Answers.UserDisplayName: Gyan
Body: <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.sstatic.net/dfTCS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/dfTCS.png" alt="Here&#39;s a screenshot of the video"></a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-23T18:17:30.023Z
Comments.Text: Is the entire 1280x720 to be kept or is the area of interest smaller? A screenshot would help.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-23T18:18:16.987Z
Comments.Text: Much smaller. I'll send a screenshot in a moment.
Comments.UserDisplayName: Smeegs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-23T18:23:07.303Z
Comments.Text: I've added a screenshot
Comments.UserDisplayName: Smeegs
Tags: <ffmpeg>
Title: Trying to resize a video by cropping the sides and adding height is it possible to do this with ffmpeg?
UserDisplayName: Smeegs
ThreadText: # Trying to resize a video by cropping the sides and adding height is it possible to do this with ffmpeg?
  
  (Asked by: username_0 on 2016-09-23)
  
  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.
  
  [![Here's a screenshot of the video](https://i.sstatic.net/dfTCS.png)](https://i.sstatic.net/dfTCS.png)
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: Is the entire 1280x720 to be kept or is the area of interest smaller? A screenshot would help.  
  > **username_0**: Much smaller. I'll send a screenshot in a moment.  
  > **username_0**: I've added a screenshot  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-09-23. Score: 1 | Accepted answer
  
  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
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks, It looks like it only added the padding on top of the video, but that might actually work better for my needs.  
  
  ---
  
  