Running FFmpeg binary executable on Android

I have an ffmpeg executable compiled for ARM Android in my /data/data/APP/files folder with permission to execute. I am trying to execute a command based on an example extracted from the FFmpeg site .

This is the command line that I type:

 ./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 

My task is to execute it from my application, but even on the command line I get this error:

 ./ffmpeg: 1: Syntax error: "(" unexpected 

Does anyone know what and how to solve it?

- UPDATE

I found a newer version and I think I went through this error.

But now, for any call to the ffmpeg executable, I get an error similar to this:

 # ./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 

What does it mean?

+6
source share
1 answer

I solved my problem using @HiteshSondhi hints and files on Cross Compiling FFmpeg with x264 for Android .

Actually, I did not compile all of FFmpeg myself. Instead, I used and configured SampleFFmpegApp , which it distributes on its GitHub page .

And one last hint: test it in a real device. This is the only place where I really could make it work well.

+1
source

Source: https://habr.com/ru/post/974658/


All Articles