1

I have built and successfully imported FFMPEG library in the android studio. How can I develop a program to stabilize a video using that?

Kamran Bashir
  • 632
  • 6
  • 12

1 Answers1

0
  1. You should implementate ffmpeg library with vid.stab like https://github.com/tanersener/mobile-ffmpeg
  2. You should give read/write storage permission
  3. You should execute two ffmpeg commands:

-y -i $VIDEO -vf vidstabdetect=shakiness=10:accuracy=15:result=${VIDEO}trfFile -f null -

-y -i $VIDEO -vf vidstabtransform=smoothing=30:input=${VIDEO}output.mp4 -c:v mpeg4 /storage/emulated/0/Android/output.mp4

Where VIDEO is constant of your video path

It takes a lot of time because FFMPEG can't use phone GPU and render takes 2 minutes of 6 seconds of video.

kx3
  • 1
  • 2