Convert aac to mp3 using ffmpeg binary command in android - android

I'm trying to use ffmpeg binary to convert aac format to mp3 format in andorid
I am too referring to a example here: https://github.com/sjitech/ffmpeg-android
What I tried with failure is
p = Runtime.getRuntime().exec("/data/data/myapp/app_bin/ffmpeg -i /sdcard/chua.aac -acodec libmp3lame -ac 2 -ab 160 /sdcard/chua.mp3");
I make sure that "/sdcard/chua.aac" exists on my phone
I guess the problem may come from libmp3lame in the command which is disabled in ffmpeg binary when building before with the example but I'm not very sure
Please someone reveal what my problem is and how to fix it.

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 android image and audio merging not woring

I am using ffmpeg for making video(mp4) of image.jpg and audio.mp3.i used -y,-i,%s,-i,%s,-shortest,-acodec,copy,-vcodec,mjpeg,-shortest,%s this as command its run well but in output getting only 1 frame. my audio file length is 3min and getting output of 1 sec.I refere this as well but not getting desire output.
Add the -loop 1 input option before -i image.jpg.

Videos splitting using FFMpeg in android

Hi i am using FFMpeg for splitting video(39MB) as 15 parts using below command and that's fine video is splitting and there is no damage.
But problem is actually my main file size is 39MB but after splitting this video then splitting video files size become very large compare to main file
When i count splitting files size it was 69MB
Can some one suggested me please.
-i "input.mp4" -ss 00:00:01 -t 00:00:03 -acodec copy -vcodec copy "output.mp4"

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

How to convert wav file to mp4 using ffmpeg in android?

I am having a wav file.How to convert wav file into mp4 file container format with AAC as audio stream using FFmpeg in android.I know how compile and port ffmpeg for android.Can anybody give me right direction
thanks,
you'll need to compile libfaac if you want to have a decent quality encoder. Then, something like ffmpeg -i foo.wav -vn -acodec libfaac -ab BITRATE output.mp4 should do the trick.

Categories

Resources