Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
613 views
in Technique[技术] by (71.8m points)

android - Compress Video with FFmpeg

I want to compress a 1 minute video in less than a minute on Android using ffmpeg in the best possible quality. But when the time is short, the quality is low and when the quality is good, it takes a long time to compress. Do you know the right command?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For "best quality" at fastest encoding speed:

ffmpeg -i input.mp4 -c:v libx264 -crf 18 -preset veryfast output.mp4
  • This assumes you want H.264 + AAC in MP4.
  • If input audio is AAC add -c:a copy.
  • If -preset veryfast is too slow use -preset ultrafast.
  • See FFmpeg Wiki: H.264 for more info and examples.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...