简体   繁体   中英

FFmpeg for Android

I'm using FFmpeg4Android for changing the resolution of videos. I can't get a good video output out of it. My command is below (copied from their website). The video looks always stretched and it doesn't looks normal. I tried so many combinations of args but I couldn't reach good results. What I need is a low a good quality video (640x360) or even less, anyone here reached the right combinations of args that achieve both fast resolution change/video compressing and good/acceptable quality using this library? Can you please advise?

I tried many resolutions and many bitrates here, none of them is good.

ffmpeg -y -i /sdcard/videokit/in.mp4 -strict experimental -s 320x240 -r 25 -aspect 3:4 -vcodec mpeg4 -b 2097152 -ab 48000 -ac 2 -ar 22050 /sdcard/videokit/out.mp4

Ok, After few hours of trial and error I reached the perfect args where it's both fast and good quality,

ffmpeg -y -i /sdcard/videokit/in.mp4 -strict experimental -s 320x240 -r 25 -aspect 16:9 -vcodec mpeg4 -b 700000 -ab 48000 -ac 2 -ar 22050 /sdcard/videokit/out.mp4

Change the -b to a higher number if you are looking for better quality but that will take a bit longer. hope it helps someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM