2010-07-10 50 views
0

我想从电影.AVI转换为iphone可读格式 无论我看,人建议以下选项的ffmpeg转换视频时保持宽高比? - FFmpeg的

的ffmpeg -s 320×240 -aspect 320:240 [...]

对于不同长宽比的视频来说,这并不是一个好兆头!


我怎样才能保持纵横比变化?有没有办法动态设置大小?

例如有高度为240和宽度可变?

回答

1

从丰富的文章摘要在这里找到:http://www.frasq.org/en/transcoding-an-audio-or-a-video-file

为了适应特定显示器的视频,重新计算其宽度以及它与以下公式推高:

aspect_ratio_of_display = width_of_display/height_of_display 
aspect_ratio_of_video = width_of_video/height_of_video 

if aspect_ratio_of_video > aspect_ratio_of_display 
then 
    height = (height_of_video/aspect_ratio_of_video) and width = width_of_display 
else 
    width = (height_of_display x aspect_ratio_of_video) and height = height_of_display 

请记住将视频的宽度和高度舍入为16的倍数。