我正在尝试将电影从 .avi 转换为 手机 可读格式
无论我在哪里看,人们建议以下 ffmpeg 的选项
ffmpeg -s 320x240 -aspect 320:240 [...]
这对于具有不同纵横比的视频来说不是一个好兆头!
如何保持纵横比不变?有没有办法动态设置大小?
例如高度为 240 且宽度可变?
最佳答案
来自此处找到的丰富文章的摘要: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 的倍数。
关于iphone - 转换视频时保持纵横比? - ffmpeg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3220536/