Skip to content

Commit 116d085

Browse files
author
Mohamed Salah
committed
optimize stabilization process.
1 parent 07881a9 commit 116d085

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/src/main/java/com/exozet/transcoder/ffmpeg/demo/FFmpegActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class FFmpegActivity : AppCompatActivity() {
6666
init_ffmpeg.text = "FFmpeg is ${if (FFMpegTranscoder.isSupported(this)) "" else "not"} supported."
6767

6868
val frameFolder = "Download/process/".parseExternalStorageFile()
69-
val inputVideo = "Download/walkaround.mp4".parseExternalStorageFile()
70-
//val inputVideo = "Download/Test.mp4".parseExternalStorageFile()
69+
//val inputVideo = "Download/walkaround.mp4".parseExternalStorageFile()
70+
val inputVideo = "Download/Test2.mp4".parseExternalStorageFile()
7171
val outputVideo = "Download/stabilizedOutput_${System.currentTimeMillis()}.mp4".parseExternalStorageFile()
7272

7373
extractFrames(inputVideo, frameFolder)

transcoder/src/main/java/com/exozet/transcoder/ffmpeg/FFMpegTranscoder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ object FFMpegTranscoder {
334334

335335
}.toTypedArray()
336336

337-
val c = "-i ${inputVideo.path} -threads ${Runtime.getRuntime().availableProcessors()} -vf [in]deflicker,dejudder[p0];[p0]vidstabdetect=shakiness=10:accuracy=15:result=${transformsFile.path}[out] -f null -"
337+
val c = "-i ${inputVideo.path} -threads ${Runtime.getRuntime().availableProcessors()} -vf [in]deflicker,dejudder[p0];[p0]vidstabdetect=stepsize=32:shakiness=10:accuracy=15:result=${transformsFile.path}[out] -f null -"
338338

339339
Config.enableStatisticsCallback {
340340
emitter.onNext(Progress(uri = Uri.EMPTY, message = "", progress = percent.get(), duration = System.currentTimeMillis() - startTime))
@@ -385,7 +385,7 @@ object FFMpegTranscoder {
385385
add("-y")
386386
add("-i"); add("${inputVideo.path}")
387387
add("-threads"); add("${Runtime.getRuntime().availableProcessors()}")
388-
add("-vf"); add("[in]deflicker,dejudder[p0];[p0]vidstabtransform=smoothing=40:input=${transformsFile.path}[p1];[p1]fps=30[out]")
388+
add("-vf"); add("[in]deflicker,dejudder[p0];[p0]vidstabtransform=input=${transformsFile.path}:zoom=0:smoothing=10,unsharp=5:5:0.8:3:3:0.4[p1];[p1]fps=30[out]")
389389
add("${outputUri.path}")
390390

391391
}.toTypedArray()

0 commit comments

Comments
 (0)