Last active
December 9, 2016 04:00
-
-
Save jordanbCS/cc4fecf81e5023430f945c1cc712d778 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Majority credit to the dozens of programmers talking through the problem on StackExchange and elsewhere | |
# Library vidstabdetect was a pain so I suggest a precompiled ffmpeg binary having it for your installation. | |
#1. build transform #2. apply transform #3. make side by side #4. extract audio from original then add it back in (side by side wouldn't know which audio to use) | |
ffmpeg_sd -i [Input]combined_segments.mp4 -vf vidstabdetect=stepsize=1:shakiness=7:accuracy=8:result=transforms.trf -f null -;ffmpeg -i [Input]combined_segments.mp4 -vf vidstabtransform=smoothing=9:input="transforms.trf" stabilized_[Input]combined_segments.mp4;ffmpeg -i [Input]combined_segments.mp4 -i stabilized_[Input]combined_segments.mp4 -filter_complex "[0:v]pad=iw*2:ih[int];[int][1:v]overlay=W/2:0[vid]" -map [vid] -c:v libx264 -crf 23 -preset veryfast [output]stabilized_[Input]combined_segments.mp4;ffmpeg -i stabilized_[Input]combined_segments.mp4 audio_copy.wav;ffmpeg -i [output]stabilized_[Input]combined_segments.mp4 -i audio_copy.wav -shortest [output]stabilized_[Input]combined_segments_wAudio.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment