<p>If <code>deshake</code> filter does not work for you then you can try to use <code>libvidstab</code> library.</p>
<p>The specific values of parameters can be hard to say without seeing your input video (you need to get them by testing) but the general workflow goes like this: first FFmpeg creates &quot;the map of shakes&quot; and then it will try to stabilize the video by using this info in its next pass.</p>
<p>Here are some examples of <a href="https://www.youtube.com/watch?v=pdriF_ATiX8" rel="nofollow noreferrer">video</a> and <a href="https://www.imakewebsites.ca/posts/2018/02/17/stabilizing-gopro-video-with-ffmpeg-and-vid.stab/" rel="nofollow noreferrer">commands</a> to use.</p>

CC BY-SA 4.0
2022-02-06T04:48:08.790Z
Okay. I can see that it make a sort of 'shake' map. Then I can apply the corrections using that map. There's no way to lock it to right and left though.
For Serious
CC BY-SA 4.0
2022-02-06T05:08:02.220Z
@ForSerious You said that movie shifts to left and to right all the time so what kind of lock do you need?
Lex
CC BY-SA 4.0
2022-02-06T05:41:19.463Z
I need it to ignore any up and down motion. The trf file creates info about each frame that looks like: Frame 92 (List 7 [(LM 0 0 301 147 48 0.062305 0.045573)...
If I knew what those meant, I could probably make a script that would generate a trf file to my exact need.
For Serious
CC BY-SA 4.0
2022-02-06T06:12:04.703Z
@ForSerious Maybe this will help you: https://github.com/georgmartius/vid.stab/issues/62
Lex
CC BY-SA 4.0
2022-02-11T20:04:49.490Z
You lead me to the answer. With that information I have been able to make a script that makes a transform file that libvidstab can read.
Manually entering the transform values from Blender will take awhile, but that's my problem.
For Serious
CC BY-SA 4.0
2022-02-11T20:17:51.517Z
@ForSerious I'm so glad to hear that! :D
Lex
CC BY-SA 4.0
2022-02-05T21:51:31.403Z
2022-02-05T21:51:31.403Z
Lex
<p>I have some copies of original theatrical films that came as bonus DVDs. These copies are in 4:3 aspect ratio but are widescreen. So playing the movies in a standard DVD player renders it in a small box with big black lines on all sides.
I have been able to fix that issue with ffmpeg.
The issue left now, is that while digitizing, it seems that whatever was used to playback the reel, wobbled in relation to whatever was capturing the image.
So throughout the whole movie, it shifts left and right a few pixels. It's not the most noticeable thing, but I feel like it is something that should be easily fixed.</p>
<p>I have tried a number of settings with the ffmpeg included filter 'deshake', but have no idea what I'm doing. It either moves things way too much, or it does nothing. It has the setting rx, that is supposed to limit the corrective movement left and right, but it gives an error when I enter a value that's not a multiple of 16. (The documentation says it can be 0-64)
Here's an example of the deshake section of the command I've been trying:</p>
<pre><code>deshake=x=0:y=150:w=720:h=60:rx=16:ry=0:edge=3:blocksize=4:filename=loog.log&quot;
</code></pre>
<p>All searches I have done come up with solutions for shaky footage from something like a GoPro.</p>
<p>How can I go about correcting the shifting with ffmpeg?</p>

<ffmpeg>
How to stablize a movie that wobbles right and left about 3 pixles throughout the whole thing?
For Serious
# How to stablize a movie that wobbles right and left about 3 pixles throughout the whole thing?

(Asked by: username_0 on 2022-02-05)

I have some copies of original theatrical films that came as bonus DVDs. These copies are in 4:3 aspect ratio but are widescreen. So playing the movies in a standard DVD player renders it in a small box with big black lines on all sides.
I have been able to fix that issue with ffmpeg.
The issue left now, is that while digitizing, it seems that whatever was used to playback the reel, wobbled in relation to whatever was capturing the image.
So throughout the whole movie, it shifts left and right a few pixels. It's not the most noticeable thing, but I feel like it is something that should be easily fixed.
I have tried a number of settings with the ffmpeg included filter 'deshake', but have no idea what I'm doing. It either moves things way too much, or it does nothing. It has the setting rx, that is supposed to limit the corrective movement left and right, but it gives an error when I enter a value that's not a multiple of 16. (The documentation says it can be 0-64)
Here's an example of the deshake section of the command I've been trying:
deshake=x=0:y=150:w=720:h=60:rx=16:ry=0:edge=3:blocksize=4:filename=loog.log"

All searches I have done come up with solutions for shaky footage from something like a GoPro.
How can I go about correcting the shifting with ffmpeg?

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2022-02-05. Score: 0 | Accepted answer

If `deshake` filter does not work for you then you can try to use `libvidstab` library.

The specific values of parameters can be hard to say without seeing your input video (you need to get them by testing) but the general workflow goes like this: first FFmpeg creates "the map of shakes" and then it will try to stabilize the video by using this info in its next pass.

Here are some examples of [video](https://www.youtube.com/watch?v=pdriF_ATiX8) and [commands](https://www.imakewebsites.ca/posts/2018/02/17/stabilizing-gopro-video-with-ffmpeg-and-vid.stab/) to use.

> **Comments:**
> **username_0**: Okay. I can see that it make a sort of 'shake' map. Then I can apply the corrections using that map. There's no way to lock it to right and left though.  
> **username_1**: @ForSerious You said that movie shifts to left and to right all the time so what kind of lock do you need?  
> **username_0**: I need it to ignore any up and down motion. The trf file creates info about each frame that looks like: Frame 92 (List 7 [(LM 0 0 301 147 48 0.062305 0.045573)... If I knew what those meant, I could probably make a script that would generate a trf file to my exact need.  
> **username_1**: @ForSerious Maybe this will help you: https://github.com/georgmartius/vid.stab/issues/62  
> **username_0**: You lead me to the answer. With that information I have been able to make a script that makes a transform file that libvidstab can read. Manually entering the transform values from Blender will take awhile, but that's my problem.  
> **username_1**: @ForSerious I'm so glad to hear that! :D  

---

