<p>Use</p>

<pre><code>ffmpeg -i L.MOV -i R.MOV -filter_complex '[0:v]crop=in_w-28:in_h-28,scale=640:480,setsar=1,pad=iw*2:ih[int];[int][1:v]overlay=W/2:0[vid]' -map [vid] -c:v libx264 -crf 23 -preset veryfast LR.MOV
</code></pre>

<p>Since you want a zoomed-in effect, after cropping, you should rescale it back to 640x480. Your crop dimensions are disproportionate to the input dimensions so I have reset SAR to 1. You can skip this if you apply <code>crop=in_w-28:in_h-21</code>.</p>

<hr>

<p>To apply the crop to the right video, use</p>

<pre><code>ffmpeg -i L.MOV -i R.MOV -filter_complex '[1:v]crop=in_w-28:in_h-21,scale=640:480[int];[0:v]pad=iw*2:ih[left];[left][int]overlay=W/2:0[vid]' -map [vid] -c:v libx264 -crf 23 -preset veryfast LR.MOV
</code></pre>

CC BY-SA 3.0
2018-04-17T17:54:27.850Z
I forgot that height not equals width. Thanks a lot.
R S
CC BY-SA 3.0
2018-04-17T20:45:56.753Z
How to rewrite command if I would need to crop right one instead of left (I can't figure that out) ?
R S
CC BY-SA 3.0
2018-04-18T05:33:13.417Z
Replace first `[0:v]` with `[1:v]` and `[int][1:v]` with `[0:v][int]`
Gyan
CC BY-SA 3.0
2018-04-18T08:50:54.780Z
it crops both videos by half.
R S
CC BY-SA 3.0
2018-04-18T10:12:33.177Z
Run command with -report and share report.
Gyan
CC BY-SA 3.0
2018-04-18T10:30:00.697Z
Here is log file: https://drive.google.com/open?id=1LlTMzD5I2YGVLG3QixTvvIb9rkww5j57
R S
CC BY-SA 3.0
2018-04-18T10:32:54.393Z
Malware detected in earlier link.
Gyan
CC BY-SA 3.0
2018-04-18T10:34:12.453Z
Use my new command in answer.
Gyan
CC BY-SA 3.0
2018-04-18T14:43:18.553Z
Malware - I've seen that. It works now - thank you very much.
R S
CC BY-SA 3.0
2018-04-17T17:08:59.630Z
2018-04-18T05:35:55.117Z
2018-04-18T05:35:55.117Z
Gyan
<p>I have 2 videos of the same resolution, but I need to crop one of them and then merging them side by side, so that general height would be equal of height of non cropped video. I.e. they should look the same size after merge. Just cropped video should look like it zoomed in.</p>

<p>I tried to do that, but <strong><em>uncropped video being cropped during merge</em></strong>.<br>
I <strong>cropped</strong> like that:</p>

<pre><code>ffmpeg -i L.MOV -filter:v "crop=in_w-28:in_h-28" -c:a copy LC.MOV
</code></pre>

<p>Then <strong>merge</strong> which crops right video:</p>

<pre><code>ffmpeg -i LC.MOV -i R.MOV -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 LCR.MOV
</code></pre>

<p>Here I drew what I need:
<a href="https://i.sstatic.net/k2Q7U.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/k2Q7U.png" alt="enter image description here"></a></p>

<p>And here what I'm getting:
<a href="https://i.sstatic.net/WVW0r.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WVW0r.png" alt="enter image description here"></a></p>

<ffmpeg><editing>
How to merge videos side by side if one of them is cropped
R S
# How to merge videos side by side if one of them is cropped

(Asked by: username_0 on 2018-04-17)

I have 2 videos of the same resolution, but I need to crop one of them and then merging them side by side, so that general height would be equal of height of non cropped video. I.e. they should look the same size after merge. Just cropped video should look like it zoomed in.
I tried to do that, but uncropped video being cropped during merge.
I cropped like that:
ffmpeg -i L.MOV -filter:v "crop=in_w-28:in_h-28" -c:a copy LC.MOV

Then merge which crops right video:
ffmpeg -i LC.MOV -i R.MOV -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 LCR.MOV

Here I drew what I need:

And here what I'm getting:

**Tags:** ffmpeg, editing


---

## 1 answers

### Answer by username_1 on 2018-04-17. Score: 4 | Accepted answer

Use
ffmpeg -i L.MOV -i R.MOV -filter_complex '[0:v]crop=in_w-28:in_h-28,scale=640:480,setsar=1,pad=iw*2:ih[int];[int][1:v]overlay=W/2:0[vid]' -map [vid] -c:v libx264 -crf 23 -preset veryfast LR.MOV

Since you want a zoomed-in effect, after cropping, you should rescale it back to 640x480. Your crop dimensions are disproportionate to the input dimensions so I have reset SAR to 1. You can skip this if you apply crop=in_w-28:in_h-21.

To apply the crop to the right video, use
ffmpeg -i L.MOV -i R.MOV -filter_complex '[1:v]crop=in_w-28:in_h-21,scale=640:480[int];[0:v]pad=iw*2:ih[left];[left][int]overlay=W/2:0[vid]' -map [vid] -c:v libx264 -crf 23 -preset veryfast LR.MOV

> **Comments:**
> **username_0**: I forgot that height not equals width. Thanks a lot.  
> **username_0**: How to rewrite command if I would need to crop right one instead of left (I can't figure that out) ?  
> **username_1**: Replace first `[0:v]` with `[1:v]` and `[int][1:v]` with `[0:v][int]`  
> **username_0**: it crops both videos by half.  
> **username_1**: Run command with -report and share report.  
> **username_0**: Here is log file: https://drive.google.com/open?id=1LlTMzD5I2YGVLG3QixTvvIb9rkww5j57  
> **username_1**: Malware detected in earlier link.  
> **username_1**: Use my new command in answer.  
> **username_0**: Malware - I've seen that. It works now - thank you very much.  

---

