7

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?

5
  • Hey Diego, can you tell me on which Android O/S you are using this ? This build only supports JB+ devices. Commented Sep 3, 2014 at 14:34
  • I've just tried to run above command and able to generate output file successfully, check output here gist.github.com/hiteshsondhi88/48783de48248ab72fc23, I've also added prebuilt binaries to the project you can use them, segmentation fault might be occurring because of incorrect binary i.e you might be using neon binary on non neon device. Commented Sep 3, 2014 at 16:45
  • Well. I don't know what was the real problem. I was getting that error running the command line into a level 19 API emulator. I solved my problem by actually coding it in my App using logcatProc = Runtime.getRuntime().exec(); and running the app on my real device (Galaxy S2 with ICS API 15). Commented Sep 3, 2014 at 17:07
  • You can't run it on emulator, most of the emulators are x86 based not ARM. Please try to run it on real device and this will probably work Commented Sep 3, 2014 at 19:33
  • Well. I don't know a lot of emulators architecture but I create an ARM emulador offered to me by the SDK. Commented Sep 4, 2014 at 0:30

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.