0

Hi I have a 400*800 resolution video , I need a 800*400 video , So all i need to do is scale the video's with to 400 and change the y position so that I can see the scaled central part of the video. I have checked online but position is available only for overlays , I need for a single video

0
1

I think if you consider this the other way around, you'll be able to do it.

If you crop the central part of the video, you'll get something that is the right aspect ratio, at 400x200:

ffmpeg -i in.mp4 -vf "crop=400:200:0:300" out.mp4

So this will crop from x=0,y=300 to x=400,y=500. You can adjust the y starting point if you don't need it exactly central.

Adding in the scaling:

ffmpeg -i in.mp4 -vf "crop=400:200:0:300, scale=w=800:h=400"  out.mp4

I am not sure how valuable scaling the result will be - I guess it depends why you need it 800px wide.

I didn't test this, I think the syntax is right.

4
  • Hi , Is there any way to move the video to right like normal video to like 10 pixels right without cropping?
    – Jeffin
    Aug 8 '17 at 6:16
  • Hi Jeffin, I am not sure what you mean by normal video. If you move a video 10 pixels to the right, doesn't that then crop 10 pixels off the right hand side?
    – Paul
    Aug 8 '17 at 6:21
  • Hey paul, am asking like a normal video of 1920*1080 video, I need to move the x position to 10 pixel or so. so the video will show some black or some color to the left 10 pexels and start from 10 pixel , you get it ?
    – Jeffin
    Aug 8 '17 at 6:56
  • 1
    Sure - but that is a different question. If you just want to add black pillars to the sides, then the question @slhck has marked this as a duplicate of has the answers.
    – Paul
    Aug 8 '17 at 6:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.