[FFmpeg-user] V360 stabilization

Paul B Mahol onemda at gmail.com
Thu Oct 1 23:11:20 EEST 2020


On Tue, Sep 29, 2020 at 10:54:54PM +0200, Michael Koch wrote:
> Hello all,
> 
> I've programmed a C# workaround for stabilization of 360° videos. The
> procedure is as follows:
> 
> 1. FFmpeg: From each frame of the equirectangular input video, extract two
> small images which are 90° apart in the input video. I call them A and B
> images.
> 
> 2. C# code: Analyze the x and y image shift from subsequent A and B images.
> Calculate how the equirectangular frames must be rotated (yaw, pitch, roll)
> to compensate the image shifts. This part wasn't easy. Two rotation matrices
> and one matrix multiplication are required. Write the results to a *.cmd
> file.
> 
> 3. FFmpeg: Read the *.cmd file and apply the rotations with the v360 filter.
> The output video is stabilized.
> 
> For details and source code please have a look at chapter 2.78 in my book:
> http://www.astro-electronic.de/FFmpeg_Book.pdf
> 
> If anyone wants to implement this in FFmpeg, please feel free to do it.

Better upload DNG files that do not decode with FFmpeg.


More information about the ffmpeg-user mailing list