<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>stabilization &#8211; Matthew Petroff</title>
	<atom:link href="https://mpetroff.net/tag/stabilization/feed/" rel="self" type="application/rss+xml" />
	<link>https://mpetroff.net</link>
	<description>mpetroff.net</description>
	<lastBuildDate>Thu, 01 Dec 2016 00:12:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Stabilizing 360 Video with Hugin</title>
		<link>https://mpetroff.net/2016/11/stabilizing-360-video-with-hugin/</link>
					<comments>https://mpetroff.net/2016/11/stabilizing-360-video-with-hugin/#comments</comments>
		
		<dc:creator><![CDATA[Matthew Petroff]]></dc:creator>
		<pubDate>Wed, 30 Nov 2016 23:51:08 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[360]]></category>
		<category><![CDATA[equirectangular]]></category>
		<category><![CDATA[Hugin]]></category>
		<category><![CDATA[stabilization]]></category>
		<category><![CDATA[video]]></category>
		<guid isPermaLink="false">https://mpetroff.net/?p=2341</guid>

					<description><![CDATA[Although there are plenty of tools that work well for stabilizing regular video, there aren&#8217;t any good ones for stabilizing 360 degree video. As I was unable to find any freely available software that worked, I used various command line &#8230; <a href="https://mpetroff.net/2016/11/stabilizing-360-video-with-hugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap">A</span>lthough there are plenty of tools that work well for stabilizing regular video, there aren&#8217;t any good ones for stabilizing 360 degree video. As I was unable to find any freely available software that worked, I used various command line tools from <a href="http://hugin.sourceforge.net/">Hugin</a> and <a href="https://www.ffmpeg.org/">FFmpeg</a>. Although this worked, it was <em>extremely</em> slow and had some issues with the horizon drifting.<sup id="rf1-2341"><a href="https://mpetroff.net/2016/11/stabilizing-360-video-with-hugin/#fn1-2341" title="Manually adding some horizontal line control points in Hugin helped in this regard." rel="footnote">1</a></sup> I can&#8217;t really recommend the approach, but I figured I&#8217;d post the technique in case anyone finds it to be useful. Hopefully Facebook with open source their <a href="https://code.facebook.com/posts/697469023742261/360-video-stabilization-a-new-algorithm-for-smoother-360-video-viewing/">360 video stabilization</a>, since it seems much better.<br />
<span id="more-2341"></span></p>
<div class="highlighted-source default bash">
<pre><span></span><span class="c1"># Extract frames from original video</span>
ffmpeg -i video.webm frame%03d.png

<span class="c1"># Create Hugin project with frames</span>
pto_gen -o project.pto -p <span class="m">4</span> -f <span class="m">360</span> frame*.png

<span class="c1"># Find control points between adjacent frames</span>
cpfind --linearmatch -o ctrlpoints.pto project.pto

<span class="c1"># Remove bad control points (optional)</span>
cpclean -p -o clean.pto ctrlpoints.pto

<span class="c1"># Optimize fit</span>
autooptimiser -p -o optimized.pto clean.pto

<span class="c1"># Change output size to match input and change output mode to only remap images</span>
pano_modify --canvas<span class="o">=</span>AUTO --output-type<span class="o">=</span>REMAPORIG -o output.pto optimized.pto

<span class="c1"># Stitch output</span>
nona -o output output.pto

<span class="c1"># Convert remapped frames back into video</span>
ffmpeg -framerate <span class="m">30</span> -i output%04d.tif -c:v libvpx -b:v 10M output-no-audio.webm

<span class="c1"># Copy audio</span>
ffmpeg -i output-no-audio.webm -i video.webm -map <span class="m">0</span>:v -map <span class="m">1</span>:a -c:v copy -c:a libvorbis output.webm
</pre>
</div>
<p><iframe width="100%" height="315" src="https://www.youtube.com/embed/TRyp1ygxnv4" frameborder="0" allowfullscreen></iframe></p>
<p><iframe loading="lazy" width="100%" height="315" src="https://www.youtube.com/embed/cIAziL4ScJQ" frameborder="0" allowfullscreen></iframe></p>
<hr class="footnotes"><ol class="footnotes" style="list-style-type:decimal"><li id="fn1-2341"><p >Manually adding some horizontal line control points in Hugin helped in this regard.&nbsp;<a href="https://mpetroff.net/2016/11/stabilizing-360-video-with-hugin/#rf1-2341" class="backlink" title="Return to footnote 1.">&#8617;</a></p></li></ol>]]></content:encoded>
					
					<wfw:commentRss>https://mpetroff.net/2016/11/stabilizing-360-video-with-hugin/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: cdn0.mpetroff.net
Minified using Disk

Served from: mpetroff.net @ 2026-03-31 01:32:35 by W3 Total Cache
-->