<p>Using the mask image below, you can use <a href="https://ffmpeg.org/download.html" rel="nofollow noreferrer">ffmpeg</a> to crop and output a MP4 with the visual content bounded in the same elliptical shape as the mask</p>
<pre><code>ffmpeg -i input.mp4 -loop 1 -i 360mask.png \
       -filter_complex &quot;[0]split[a][b]; \
        [a]crop=iw/2:1522:0:300,crop=iw*0.8:ih*0.8,scale=960:-1,pad=960:960:0:150[l]; \
        [b]crop=iw/2:1522:iw/2:300,crop=iw*0.8:ih*0.8,scale=960:-1,pad=960:960:0:150[r]; \
        [l][r]hstack[c]; [c][1]alphamerge[ca]; [1][ca]overlay=shortest=1&quot;    vr.mp4
</code></pre>
<p>The video is split into two cropped halves to a rectangle which exactly bounds the visual area, then cropped to 80% along each of its dimensions, and then scaled and padded to a 960x960 canvas, rejoined to form a 1920x960 frame. Then the mask is applied to form the elliptical cut-out.</p>
<h3>Mask</h3>
<p><a href="https://i.sstatic.net/kgCmO.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kgCmO.png" alt="enter image description here" /></a></p>
<hr />
<p>This is the basic technique. The visuals in your supplied image aren't centered, so I customized the crop expressions based on measurements within an image editor.</p>

CC BY-SA 3.0
2016-05-15T11:21:12.550Z
Thank you, that solves the elliptical shape, but the original obstacle remains. "I have to crop both sides separately and then join them together as they were." Please see the image I have added to my question. Fo the last part of your answer: I'm not sure what you mean but you probably referring to shift caused by 3D (each side is supposed to be a little different).
Saix
CC BY-SA 3.0
2016-05-15T11:33:52.373Z
I'll update the command later for the split and crop method.
Gyan
CC BY-SA 3.0
2016-05-18T13:41:59.610Z
Command updated for your given sample.
Gyan
CC BY-SA 3.0
2016-05-18T19:14:22.530Z
Thank you! Works like a charm. Without previous experience with ffmpeg on this level I wouldn't come up with something like that.
Saix
CC BY-SA 3.0
2016-05-15T10:43:16.980Z
2016-05-18T13:47:46.800Z
2020-06-17T09:53:03.607Z
Gyan
<p>I have mp4 SBS 180 VR videos made for Oculus Rift. I'd like to crop the videos a little (simulate the zoom) and then downscale to "cardboard" resolution so it would be smoothly playable on mobile devices.</p>

<p>Some mobile players have already zoom function built in, but this should work as a workaround for keeping the picture sharp (working down from the big resolution) at the expanse of FOV.</p>

<p>Pretty soon I realized I can't simply crop the whole video. I have to crop both sides separately and then join them together as they were.</p>

<p>Could you point me to video-editing software (preferably free and fast to learn) that would allow me to do such thing?</p>

<p><a href="https://i.sstatic.net/t3m7u.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/t3m7u.jpg" alt="enter image description here"></a></p>

CC BY-SA 3.0
2016-05-14T17:15:54.333Z
Can you post a screenshot of a single frame - both full and how you'd like it cropped and altered?
Gyan
CC BY-SA 3.0
2016-05-14T19:21:03.807Z
@Mulvya I'm affraid I can't, so I decided to google for example. Yet I couldn't find a single screenshot sample that would fit my video, except adult ones. After a while a find a sample, that I hope should be considered rated E for everyone. But as you were asking for the final crop sample I realized it can't be cropped as a rectangle. It would have to maintain this elliptical shape. There would be a specific app for this purpose needed, I guess. https://i0.wp.com/rack.2.mshcdn.com/media/ZgkyMDE1LzA1LzI5LzY3L1NjcmVlbnNob3QyLjc4ZDBiLmpwZwpwCXRodW1iCTEyMDB4OTYwMD4/4064deaa/36e/Screenshot-2-1.jpg
Saix
CC BY-SA 3.0
2016-05-14T20:17:14.323Z
The frame will remain rectangular, but if the visuals have to be cut in an elliptical shape, that can be taken care of.
Gyan
CC BY-SA 3.0
2016-05-14T20:24:33.710Z
@Mulvya Glad to hear it. Any way I could have done it without expensive tools?
Saix
CC BY-SA 3.0
2016-05-14T20:30:43.143Z
Yeah, ffmpeg is my candidate. But to confirm what I have in mind, can you point me to a file?
Gyan
CC BY-SA 3.0
2016-05-14T20:56:02.833Z
@Mulvya Can't you just throw a not-tested command line at me? I would fiddle with it and make it and find my way around. Or use this as a template? It's the final version though. Original is 3840x1920 which needs to be cropped a little and then downsized to fit this example: http://imgur.com/UurGhJ1
Saix
<ffmpeg><video-editor><3d>
Cropping VR video afterwards
Saix
# Cropping VR video afterwards

(Asked by: username_0 on 2016-05-14)

I have mp4 SBS 180 VR videos made for Oculus Rift. I'd like to crop the videos a little (simulate the zoom) and then downscale to "cardboard" resolution so it would be smoothly playable on mobile devices.

Some mobile players have already zoom function built in, but this should work as a workaround for keeping the picture sharp (working down from the big resolution) at the expanse of FOV.

Pretty soon I realized I can't simply crop the whole video. I have to crop both sides separately and then join them together as they were.

Could you point me to video-editing software (preferably free and fast to learn) that would allow me to do such thing?

[![enter image description here](https://i.sstatic.net/t3m7u.jpg)](https://i.sstatic.net/t3m7u.jpg)

**Tags:** ffmpeg, video-editor, 3d

> **Comments:**
> **username_1**: Can you post a screenshot of a single frame - both full and how you'd like it cropped and altered?  
> **username_0**: @Mulvya I'm affraid I can't, so I decided to google for example. Yet I couldn't find a single screenshot sample that would fit my video, except adult ones. After a while a find a sample, that I hope should be considered rated E for everyone. But as you were asking for the final crop sample I realized it can't be cropped as a rectangle. It would have to maintain this elliptical shape. There would be a specific app for this purpose needed, I guess. https://i0.wp.com/rack.2.mshcdn.com/media/ZgkyMDE1LzA1LzI5LzY3L1NjcmVlbnNob3QyLjc4ZDBiLmpwZwpwCXRodW1iCTEyMDB4OTYwMD4/4064deaa/36e/Screenshot-2-1.jpg  
> **username_1**: The frame will remain rectangular, but if the visuals have to be cut in an elliptical shape, that can be taken care of.  
> **username_0**: @Mulvya Glad to hear it. Any way I could have done it without expensive tools?  
> **username_1**: Yeah, ffmpeg is my candidate. But to confirm what I have in mind, can you point me to a file?  
> **username_0**: @Mulvya Can't you just throw a not-tested command line at me? I would fiddle with it and make it and find my way around. Or use this as a template? It's the final version though. Original is 3840x1920 which needs to be cropped a little and then downsized to fit this example: http://imgur.com/UurGhJ1  

---

## 1 answers

### Answer by username_1 on 2016-05-15. Score: 1 | Accepted answer

Using the mask image below, you can use ffmpeg to crop and output a MP4 with the visual content bounded in the same elliptical shape as the mask
ffmpeg -i input.mp4 -loop 1 -i 360mask.png \
       -filter_complex "[0]split[a][b]; \
        [a]crop=iw/2:1522:0:300,crop=iw*0.8:ih*0.8,scale=960:-1,pad=960:960:0:150[l]; \
        [b]crop=iw/2:1522:iw/2:300,crop=iw*0.8:ih*0.8,scale=960:-1,pad=960:960:0:150[r]; \
        [l][r]hstack[c]; [c][1]alphamerge[ca]; [1][ca]overlay=shortest=1"    vr.mp4

The video is split into two cropped halves to a rectangle which exactly bounds the visual area, then cropped to 80% along each of its dimensions, and then scaled and padded to a 960x960 canvas, rejoined to form a 1920x960 frame. Then the mask is applied to form the elliptical cut-out.
Mask


This is the basic technique. The visuals in your supplied image aren't centered, so I customized the crop expressions based on measurements within an image editor.

> **Comments:**
> **username_0**: Thank you, that solves the elliptical shape, but the original obstacle remains. "I have to crop both sides separately and then join them together as they were." Please see the image I have added to my question. Fo the last part of your answer: I'm not sure what you mean but you probably referring to shift caused by 3D (each side is supposed to be a little different).  
> **username_1**: I'll update the command later for the split and crop method.  
> **username_1**: Command updated for your given sample.  
> **username_0**: Thank you! Works like a charm. Without previous experience with ffmpeg on this level I wouldn't come up with something like that.  

---

