我的 /data/data/APP/files
文件夹中有一个为 ARM Android 编译的 ffmpeg
可执行文件,具有执行权限。
我正在尝试根据从 FFmpeg site 中提取的示例执行命令.
这是我输入的命令行:
./ffmpeg -loop 1 -i /mnt/sdcard/com.example.test/image.png -c:v libx264 -t 30 -pix_fmt yuv420p /mnt/sdcard/com.example.test/video.mp4
我的目标是从我的应用程序执行它,但即使在命令行中,我也会收到此错误:
./ffmpeg: 1: Syntax error: "(" unexpected
有谁知道这是什么以及如何解决?
- 更新
我找到了一个 newer version我想我已经通过了那个错误。
但是现在,对于 ffmpeg
可执行文件的任何调用,我都会收到这样的错误:
# ./ffmpeg -loop 1 -i /mnt/sdcard/com.example.teste/imagem.png -c:v libx264 -t 30 -pix_fmt yuv420p /mnt/sdcard/com.example.teste/video.mp4
[1] + Stopped (signal) ./ffmpeg -loop 1 -i /mnt/sdcard/com.example.teste/imagem.png -c:v libx264 -t 30 -pix_fmt yuv420p /mnt/sdcard/com.example.teste/video.mp4
[1] Segmentation fault ./ffmpeg -loop 1 -i /mnt/sdcard/com.example.teste/imagem.png -c:v libx264 -t 30 -pix_fmt yuv420p /mnt/sdcard/com.example.teste/video.mp4
这是什么意思?
最佳答案
我通过在 Cross Compiling FFmpeg with x264 for Android 上使用@HiteshSondhi 的提示和文件解决了我的问题。 .
实际上,我并没有自己编译整个 FFmpeg。相反,我使用并配置了他在 his GitHub page 分发的 SampleFFmpegApp
.
最后的提示:在真实设备中进行测试。这是我真正可以让它正常工作的唯一地方。
关于android - 在 Android 中运行 FFmpeg 可执行二进制文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25612604/