<p>Thanks to @Gyan, I was able to fix it.</p>

<pre><code>ffmpeg -i input.mp4 -vf "geq=p(mod(X+Y*2\,W)\, Y)" output.mp4
</code></pre>

CC BY-SA 4.0
2020-01-13T21:48:22.210Z
2020-01-13T21:48:22.210Z
Bendie
<p>In our university sometimes the recordings of videos are very distorted.</p>

<p>Example frame (please ignore the red bar it's just there for privacy reasons):</p>

<p><a href="https://i.sstatic.net/oQCpS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oQCpS.png" alt="Example Frame"></a></p>

<p>I know that basically I would need to move each pixel of each frame horizontally based on its vertical position. Is there a way to do this with FFmpeg?</p>

<p>Thanks in advance!</p>

CC BY-SA 4.0
2020-01-13T19:49:59.553Z
See the geq filter
Gyan
CC BY-SA 4.0
2020-01-13T20:28:38.583Z
Thanks Gyan, this seems good. But sadly I see that when the position would be outside the frame, it just uses the edge. Is there a way to set it to repeat?
Bendie
<ffmpeg>
Fix distorted mp4 files
Bendie
# Fix distorted mp4 files

(Asked by: username_0 on 2020-01-13)

In our university sometimes the recordings of videos are very distorted.

Example frame (please ignore the red bar it's just there for privacy reasons):

[![Example Frame](https://i.sstatic.net/oQCpS.png)](https://i.sstatic.net/oQCpS.png)

I know that basically I would need to move each pixel of each frame horizontally based on its vertical position. Is there a way to do this with FFmpeg?

Thanks in advance!

**Tags:** ffmpeg

> **Comments:**
> **username_1**: See the geq filter  
> **username_0**: Thanks username_1, this seems good. But sadly I see that when the position would be outside the frame, it just uses the edge. Is there a way to set it to repeat?  

---

## 1 answers

### Answer by username_0 on 2020-01-13. Score: 1

Thanks to @username_1, I was able to fix it.
ffmpeg -i input.mp4 -vf "geq=p(mod(X+Y*2\,W)\, Y)" output.mp4


---

