FFMPEG: How to move the video without stretching it?

天大地大妈咪最大 提交于 2019-12-11 07:55:06

问题


Please, I need help with the following ...

I want to move a video (portrait type), but without stretching it ... To create a 16: 9 video, with FFMPEG ... I have the following example ...

ffmpeg -i video.mpg -filter:v "crop=in_w-100:in_h-100:0:(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t)" -y out.mp4


回答1:


Wow, I do not know what I was thinking ... The answer was simple, indicate the HxW of the output video ...

ffmpeg -i video.mpg -filter:v "crop=1280:720:0:(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t)" -y out.mp4

But: How do I resize the background video, if I want to create a 640x360 video?

I tried to include "scale" and do some tests, but I still can NOT make the background video, also scale to 640x360. ffmpeg -i test.mp4 -filter:v "crop=640:360:0:(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t),scale=640:360" out.mp4.

Video output: https://youtu.be/TCOLbbereQU



来源:https://stackoverflow.com/questions/54526345/ffmpeg-how-to-move-the-video-without-stretching-it

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!