Skip to content

Instantly share code, notes, and snippets.

@max-mapper
Last active January 31, 2025 03:52
Show Gist options
  • Select an option

  • Save max-mapper/43219d6dcb9006042849 to your computer and use it in GitHub Desktop.

Select an option

Save max-mapper/43219d6dcb9006042849 to your computer and use it in GitHub Desktop.

Revisions

  1. max-mapper revised this gist Apr 4, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,8 @@

    Examples here use the default settings, see the [VidStab readme on GitHub](https://github.com/georgmartius/vid.stab) for more advanced instructions.

    [Here's an example video I made](https://www.youtube.com/watch?v=un7OSEjuMhI)

    #### Install ffmpeg with the vidstab plugin from homebrew

    ```
  2. max-mapper created this gist Dec 20, 2015.
    33 changes: 33 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    ## Video stabilization using VidStab and FFMPEG

    Examples here use the default settings, see the [VidStab readme on GitHub](https://github.com/georgmartius/vid.stab) for more advanced instructions.

    #### Install ffmpeg with the vidstab plugin from homebrew

    ```
    brew install ffmpeg --with-libvidstab
    ```

    #### Analyze your video to create a `.trf` file

    This won't modify your video or create a new video, but it should create a new file called `transform.trf`

    ```
    ffmpeg -i clip.mov -vf vidstabdetect -f null -
    ```

    #### Use the `.trf` file to create a stabilized video

    ```
    ffmpeg -i clip.mov -vf vidstabtransform=smoothing=5:input="transforms.trf" clip-stabilized.mov
    ```

    This should create a new stabilized video called `clip-stabilized.mov`

    #### Bonus: create a side by side comparison video

    Found on a forum [here](http://ffmpeg-users.933282.n4.nabble.com/Merge-two-videos-into-one-with-side-by-side-composition-td4659527.html)

    ```
    ffmpeg -i Clip8.mov -i Clip8-vidstab.mov -filter_complex "[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w" merged.mov
    ```