Skip to content

Instantly share code, notes, and snippets.

@WesleyE
Created August 22, 2015 20:15
Show Gist options
  • Save WesleyE/2893cc2def6f77e7580d to your computer and use it in GitHub Desktop.
Save WesleyE/2893cc2def6f77e7580d to your computer and use it in GitHub Desktop.
A good few years ago, this was my quick way of stitching an video with PTGUI and Hugin. Requires Hugin, a project file for one of the frames and FFMPEG.
ffmpeg -i GOPR0011.MP4 -f image2 GOPR0011/GOPR0011_%3d.jpg
ffmpeg -i GOPR0012.MP4 -f image2 GOPR0012/GOPR0012_%3d.jpg
ffmpeg -i GOPR0015.MP4 -f image2 GOPR0015/GOPR0015_%3d.jpg
ffmpeg -i GOPR2943.MP4 -f image2 GOPR2943/GOPR2943_%3d.jpg
ffmpeg -i GOPR8717.MP4 -f image2 GOPR8717/GOPR8717_%3d.jpg
pause
import os
import os.path
numFiles = 4892
for i in range(1, numFiles):
paddedNumber = '%03d' %i
paddedNumberExtra = '%04d' %i
os.system('"C:/Program Files (x86)/Hugin/bin/nona.exe" -o temp projectfile.pto GOPR0011/GOPR0011_'+paddedNumber+'.jpg GOPR0012/GOPR0012_'+paddedNumber+'.jpg GOPR0015/GOPR0015_'+paddedNumber+'.jpg GOPR2943/GOPR2943_'+paddedNumber+'.jpg GOPR8717/GOPR8717_'+paddedNumber+'.jpg')
os.system('"C:/Program Files (x86)/Hugin/bin/enblend.exe" --no-optimize -o stitched/output_' + paddedNumberExtra + '.jpg temp0000.tif temp0001.tif temp0002.tif temp0003.tif temp004.tif')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment