Image overlay fails using FFMPEG4Android - android

I am trying to watermark a video using FFMPEG4Android.
I am using the app on the android market from here.
The command used is
ffmpeg -i /sdcard/videokit/in.mp4 -i /sdcard/videokit/logos/1.png -i
/sdcard/videokit/logos/2.png -i /logos/3.png -filter_complex
"[0:v][1:v]
overlay=main_w-overlay_w-10:main_h-overlay_h-10:enable='between(t,0,1)'
[tmp]; [tmp][2:v]
overlay=main_w-overlay_w-10:main_h-overlay_h-10:enable='between(t,2,3)'
[tmp2]; [tmp2][3:v]
overlay=main_w-overlay_w-10:main_h-overlay_h-10:enable='between(t,4,5)'"
/sdcard/videokit/output.mp4
But everytime I run the command the app fails
Opening an output file:
overlay=main_w-overlay_w-10:main_h-overlay_h-10:enable='between(t,0,1)'.
No such filter: '' Error configuring filters. exit_program: 1
Can I get any help for the same?

You need to use complex command, check the ffmpeg4android blog for examples

Related

ffmpeg - 'No such file or directory' though the file exists

I am running following command to extract audio from videos and merge them into a single file:
-y -hide_banner -i /storage/emulated/0/Videos/video_4.mp4 -i /storage/emulated/0/WhatsApp/Media/WhatsApp Video/VID-20210430-WA0010.mp4 -i /storage/emulated/0/WhatsApp/Media/WhatsApp Video/VID-20210430-WA0052.mp4 -filter_complex [0:a]atrim=duration=1119.028,volume=1[a_0];[1:a]atrim=duration=84.057,volume=1[a_1];[2:a]atrim=duration=278.029,volume=1[a_2];[a_0][a_1][a_2]concat=n=3:v=0:a=1[audio] -map [audio] -acodec aac -vn /storage/emulated/0/Videos/audio.aac
But ffmpeg says
/storage/emulated/0/Videos/video_4.mp4: No such file or directory
I can ensure that the file exist on that specified path. What might cause the issue?
Note: The same error occures for some other comands too, but in all the cases the video file exist in the specified path.
I had the same problem, I installed it using snap.
So, as a solution, I tried uninstalling using remove and purge, and then I used mv /snap/bin/ffmpeg /snap/bin/ffmpeg_old.
Then I installed using apt-get install ffmpeg, and worked. I guess the problem was the version of ffmpeg.

FFmpeg sdl output in android

I try to execute the next command
-i $inputFilePath -filter_complex \"realtime,scale=iw/2:-1,negate,format=yuv420p\" -f sdl2 -
with mobile-ffmpeg on android and get the next error
mobile-ffmpeg: [sdl,sdl2 # 0xbf1d9600] Unable to initialize SDL: Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?
As far as I understand I need to create SDL_Activity or something similar to display video, am I right? Please explain if I'm wrong otherwise help me.

FFMPEG build not able to recognize image file on Android

I am trying to convert a series of images to video on Android. I have successfully built Guardian Project. Now when I try to run this command
/data/data/com.mobvcasting.mjpegffmpeg/ffmpeg -r 4 -i /mnt/sdcard/RAS/img/file%03d.bmp -r /mnt/sdcard/RAS/img/demoFile.mp4"
i get an error saying
10-02 05:48:35.247: V/PROJECT_NAME(13972): ***/mnt/sdcard/RAS/img/file%03d.bmp: No such file or directory***
I have images at /mnt/sdcard/RAS/img/ directory starting from file000.bmp.
I even tried changing my command to
/data/data/com.mobvcasting.mjpegffmpeg/ffmpeg -r 4 -i /mnt/sdcard/RAS/img/file000.bmp -r /mnt/sdcard/RAS/img/demoFile.mp4"
to get the same error again.
Also, it is able to recognize /mnt/sdcard/RAS/img/ as a directory.
What can I change to get rid of the error message?
Thanks!

ffmpeg commands for merge the image with video file in android

I am working on add watermark on video file in android with the use of ffmpeg jni what i have not found any solution for the same . i am using this command "ffmpeg -i alldone.mp4 -i cancel_bttn.png -filter_complex "overlay=main_w/2-overlay_w/2:main_h/2-overlay_h/2" record.mp4 " but this was not worked.

ffmpeg watermark

I am using a static compiled lib of FFMPEG gotten from BAMBUSER for android.
The problem I am facing now is that FFMPEG version gotten from BAMBUSER does not support watermarking.
ffmpeg -sameq -i mirror_watermark.mp4 -vf "movie=mirror_watermark.png [logo]; [in][logo] overlay=main_w-overlay_w:main_h-overlay_h [out]" output.mp4
No such filter: 'movie'
./configure --list-filters | grep movie
returns nothing
So I guess I have to use a newer version of FFMPEG but I do not know how to get started since with the BAMBUSER everything was already set I just added certain encoders and decoders to their script.
I used this as a reference for compiling newer FFMPEG version which supports watermarking:
https://github.com/guardianproject/android-ffmpeg
You can Use -overlay for it. This Will Add Your Watermark on a Particular position on the image or video as per dimensions.
Use below command:
-ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Categories

Resources