gpt4 book ai didi

android - FFMPEG 命令在 Android Q 中不起作用

转载 作者:太空狗 更新时间:2023-10-29 14:34:55 25 4
gpt4 key购买 nike

尝试使用此命令合并两个音频文件,但在 target sdk 29 时它在 Android 10.0(Q) 中不起作用。但是,此命令完全适用于targeting sdk 24 to 28

我正在使用这个 FFMPEG 实现库 'nl.bravobit:android-ffmpeg:1.1.7'

"-y", "-i", path1, "-i", path2, "-filter_complex", "[0:0][1:0] amix=inputs=2:duration=longest", "-c:a", "libmp3lame", savedPath

my Error log:
2019-09-28 13:48:32.037 16041-16166/com.merger.cut E/FFmpeg: Exception while trying to run: [/data/user/0/com..merger.cut/files/ffmpeg, -y, -i, /storage/emulated/0/Music/song1.mp3, -i, /storage/emulated/0/Music/song2.mp3, -filter_complex, [0:0][1:0] amix=inputs=2:duration=longest, -c:a, libmp3lame, /storage/emulated/0/merger/Merge_1569658695254.mp3]
java.io.IOException: Cannot run program "/data/user/0/com.merger.cut/files/ffmpeg": error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1050)
at nl.bravobit.ffmpeg.ShellCommand.run(ShellCommand.java:15)
at nl.bravobit.ffmpeg.FFcommandExecuteAsyncTask.doInBackground(FFcommandExecuteAsyncTask.java:43)
at nl.bravobit.ffmpeg.FFcommandExecuteAsyncTask.doInBackground(FFcommandExecuteAsyncTask.java:12)
at android.os.AsyncTask$3.call(AsyncTask.java:378)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.io.IOException: error=13, Permission denied
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:133)
at java.lang.ProcessImpl.start(ProcessImpl.java:141)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at nl.bravobit.ffmpeg.ShellCommand.run(ShellCommand.java:15) 
at nl.bravobit.ffmpeg.FFcommandExecuteAsyncTask.doInBackground(FFcommandExecuteAsyncTask.java:43) 
at nl.bravobit.ffmpeg.FFcommandExecuteAsyncTask.doInBackground(FFcommandExecuteAsyncTask.java:12) 
at android.os.AsyncTask$3.call(AsyncTask.java:378) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:919) 
2019-09-28 13:48:32.146 16041-16041/com.merger.cut E/FFMPEG :: on finish

给我解决上述问题。

最佳答案

现在,如果你们正在寻找适用于 ANDROID Q 的 FFMPEG,请使用下面的 FFMPEG 构建链接。将此包含到您的 app/build.gradle

最低 SDK 24

  dependencies {
implementation 'com.arthenica:mobile-ffmpeg-full:4.3'
}

最小 SDK 16

dependencies {
implementation 'com.arthenica:mobile-ffmpeg-full:4.2.2.LTS'
}

OnePlus 7T
中测试Android Q

关于android - FFMPEG 命令在 Android Q 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58143381/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com