Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run FFmpeg executable binary in Android

Tags:

android

ffmpeg

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

This is the command-line I'm typing:

./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 objetive is to execute it from my app, but even in command-line, I'm getting this error:

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

Does anyone know what is and how to solve it?

- UPDATE

I found a newer version and I think I passed through that error.

But now, for any call to ffmpeg executable, I'm getting an error like 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?

like image 581
Diego Stiehl Avatar asked Sep 01 '14 20:09

Diego Stiehl


1 Answers

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

Actually, I didn't compile the whole FFmpeg by myself. Instead, I used and configured the SampleFFmpegApp he distributes at his GitHub page.

And the final hint: Test it in a real device. That's the only place I really could get it to work well.

like image 151
Diego Stiehl Avatar answered Nov 18 '22 03:11

Diego Stiehl