Skip to content

Commit c3c3f6a

Browse files
committed
added stabilization scripts
1 parent 1b55f50 commit c3c3f6a

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
ffmpeg -i stabilized_deshake.mp4 -i source_video.mp4 -i stabilized_vidstab.mp4 -filter_complex "[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w" merged.mp4
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
# https://www.ffmpeg.org/ffmpeg-filters.html#deshake
4+
5+
ffmpeg -i source_video.mp4 -vf deshake stabilized_deshake.mp4
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
# https://ffmpeg.org/ffmpeg-filters.html#vidstabdetect-1
4+
#
5+
# shakiness
6+
# Set how shaky the video is and how quick the camera is. It accepts an integer in the range 1-10,
7+
# a value of 1 means little shakiness, a value of 10 means strong shakiness. Default value is 5.
8+
#
9+
# accuracy
10+
# Set the accuracy of the detection process. It must be a value in the range 1-15.
11+
# A value of 1 means low accuracy, a value of 15 means high accuracy. Default value is 15.
12+
#
13+
# smoothing
14+
# Set the number of frames (value*2 + 1) used for lowpass filtering the camera movements.
15+
# Default value is 10.
16+
#
17+
# For example a number of 10 means that 21 frames are used (10 in the past and 10 in the future)
18+
# to smoothen the motion in the video. A larger value leads to a smoother video,
19+
# but limits the acceleration of the camera (pan/tilt movements). 0 is a special case where a static camera is simulated.
20+
21+
ffmpeg -i source_video.mp4 -vf vidstabdetect=shakiness=10:accuracy=15 -f null -
22+
ffmpeg -i source_video.mp4 -vf vidstabtransform=smoothing=30:input="transforms.trf" stabilized_vidstab.mp4

tests/stabilization/source_video.mp4

32.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)