简体   繁体   English

Ffmpeg Android - 将 WAV 转换为 MP3 的最小二进制大小

[英]Ffmpeg Android - Minimum binary size to convert WAV to MP3

The only thing I want to do is convert wav files to mp3 inside my Android application.我唯一想做的就是在我的 Android 应用程序中将 wav 文件转换为 mp3。

I am currently using https://github.com/tanersener/mobile-ffmpeg and with audio-release everything is working fine.我目前正在使用https://github.com/tanersener/mobile-ffmpeg并且使用音频发布一切正常。 As the lib size is about 40 MB and I only need a single command, I'd like to build my own .aar file as described in the Wiki to reduce the application size.由于 lib 大小约为 40 MB,我只需要一个命令,我想按照 Wiki 中的描述构建自己的 .aar 文件以减小应用程序大小。

I edited the android-ffmpeh.sh ./configure:我编辑了android-ffmpeh.sh ./configure:

--disable-everything \    
--enable-pthreads \
--enable-avcodec \
--enable-avformat \
--enable-swresample \
--enable-avfilter \
--enable-libmp3lame \
--enable-parser=mpegaudio \
--enable-demuxer=mp3,wav,pcm_s16le \
--enable-muxer=mp3,wav,pcm_s16le \
--enable-decoder=pcm*,mp3*,wav,pcm_s16le \
--enable-encoder=pcm*,pcm_s16le,wav,mp3,libmp3lame \
--enable-filter=aresample \
--enable-protocol=file \

and then ran ./android.sh -l --enable-lame --enable-libiconv然后运行./android.sh -l --enable-lame --enable-libiconv

In my Android app FFmpeg loads but the conversion doesn't succed with following error:在我的 Android 应用程序 FFmpeg 中加载,但转换未成功并出现以下错误:

E/mobile-ffmpeg: [AVFilterGraph @ 0x7209dfec40] No such filter: 'anull'
E/mobile-ffmpeg: Error reinitializing filters!
E/mobile-ffmpeg: Failed to inject frame into filter network: Invalid argument
E/mobile-ffmpeg: Error while processing the decoded data for stream #0:0
I/mobile-ffmpeg: Conversion failed!

Does anyone know what I'm missing or another config to build a minimal size binary for this.有谁知道我缺少什么或其他配置来为此构建最小大小的二进制文件。 Any help is highly appreciated!任何帮助表示高度赞赏!

The ffmpeg tools can call upon the following filters automatically: aformat anull atrim format hflip null transpose trim vflip . ffmpeg工具可以自动调用以下过滤器: aformat anull atrim format hflip null transpose trim vflip configure is set to select them automatically unless overridden, which you have by declaring --disable-everything . configure设置为自动选择它们,除非被覆盖,您可以通过声明--disable-everything So, these filters need to be manually enabled.因此,需要手动启用这些过滤器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM