User Tools

Site Tools


doc:appunti:linux:video:fix_smartphone_portrait_videos

This is an old revision of the document!


Convert a Smartphone's Portrait Video into Landscape, with ffmpeg

We have a problem: nowday too much people have a smartphone which is capable to take videos of very good quality. But very few of them realize that we have (generally) two eyes: one on the right and the other on the left; they think that we have one eye above and the other to the bottom, so they keep to take videos with the smartphone in the portrait orientation.

This is not a really problem, if we keep that videos in the phone and we watch at them in that miniature screen (until the phone is lost/broken/stolen). But it is really unacceptable if we want to watch at them using a normal, modern screen, which has inevitably a 16:9 aspect ratio. We will face at two equally unacceptable situations: the video player does not apply the rotation metatag contained into the video, or the video player adds two lateral black bands:

Original video, viewd with no rotation The video viewd with lateral black bands

The Compromise Solution

A compromise solution is to cut out a central area of the video and add to the sides some artifact that simulates the presence of a portion of video that does not actually exist. I find that solution by far more acceptable than the original video:

The interpolated video

So we have to:

  1. Choose a region to crop from the original video. It can vary from a square to the full portrait rectangle.
  2. Make a fake background blurring the cropped region and stretching it to the 16:9 aspect ratio.
  3. Overlay the cropped region over the fake background.
doc/appunti/linux/video/fix_smartphone_portrait_videos.1523080939.txt.gz · Last modified: 2018/04/07 08:02 by niccolo