Skip to content

Commit 8b5d224

Browse files
committed
added example for deshake and vidstab
1 parent c3c3f6a commit 8b5d224

8 files changed

+1924
-3
lines changed
82.2 MB
Binary file not shown.
53.3 MB
Binary file not shown.
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+
sh ffmpeg_stabilization_deshake.sh
4+
sh ffmpeg_stabilization_vidstab.sh
5+
sh ffmpeg_side_by_side.sh
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
#!/usr/bin/env bash
22

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
3+
# 2 videos side by side
4+
ffmpeg -i stabilized_deshake.mp4 -i stabilized_vidstab.mp4 -filter_complex "[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w" deshake_vidstab.mp4
5+
6+
# 3 videos side by side
7+
8+
ffmpeg -i stabilized_deshake.mp4 -i source_video.mp4 -i stabilized_vidstab.mp4 -filter_complex "[1:v][0:v]scale2ref=oh*mdar:ih[1v][0v];[2:v][0v]scale2ref=oh*mdar:ih[2v][0v];[0v][1v][2v]hstack=3,scale='2*trunc(iw/2)':'2*trunc(ih/2)'" deshake_source_vidstab.mp4

tests/stabilization/ffmpeg_stabilization_vidstab.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env bash
22

3+
# ffmpeg vidstab installation guide:
4+
# https://github.com/varenc/homebrew-ffmpeg#installation-and-usage
5+
#
36
# https://ffmpeg.org/ffmpeg-filters.html#vidstabdetect-1
7+
# https://github.com/georgmartius/vid.stab
48
#
59
# shakiness
610
# Set how shaky the video is and how quick the camera is. It accepts an integer in the range 1-10,
@@ -17,6 +21,8 @@
1721
# For example a number of 10 means that 21 frames are used (10 in the past and 10 in the future)
1822
# to smoothen the motion in the video. A larger value leads to a smoother video,
1923
# but limits the acceleration of the camera (pan/tilt movements). 0 is a special case where a static camera is simulated.
20-
24+
#
25+
# an
26+
# removes audio track
2127
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
28+
ffmpeg -i source_video.mp4 -vf vidstabtransform=smoothing=30:input="transforms.trf" -an stabilized_vidstab.mp4
29.9 MB
Binary file not shown.
27.8 MB
Binary file not shown.

tests/stabilization/transforms.trf

Lines changed: 1905 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)