如何使音频转换超快?
现在,要转换大约2mb大小的音频,需要花费超过2分钟的时间。
我用于执行转换的命令是
String[] cmd = {"-y", "-i", audioPath, outputPath};
如何预设超快速模式?当我尝试像
String[] cmd = {"-y", "-i", audioPath,"-preset", "ultrafast" ,outputPath};
本身需要花费相同的时间。使用库https://github.com/WritingMinds/ffmpeg-android-java
日志:
任何帮助将不胜感激。
最佳答案
3.0版本分支很旧。尝试更新的版本。作为默认的-aac_coder
选项值changed从twoloop
到fast
,它可能会更快。在3.0分支中缺少此更改。
另外,您可以简单地添加-aac_coder fast
输出选项,但由于缺少一些其他相关更改,因此我建议您进行更新。
至于-preset ultrafast
,这是日志中提到的某些视频编码器的private option:
AVOption preset (Set the encoding preset (cf. x264 --fullhelp)) specified for output file
#0 (/storage/emulated/0/SACLO.m4a) has not been used for any stream. The most likely reason
is either wrong type (e.g. a video option with no video streams) or that it is a private
option of some encoder which was not actually used for any stream.