GithubHelp home page GithubHelp logo

96fps / thetas-video-remap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prouast/equirectangular-remap

15.0 5.0 3.0 25.18 MB

Generate maps for Theta S spherical video with ffmpeg

License: Other

C 100.00%
360-video 360 theta ffmpeg spherical-panoramas spherical-camera photosphere

thetas-video-remap's Introduction

ThetaS-video-remap

Example ➡️ Result

Generate maps for ffmpeg to convert of spherical video from the dual-full frame fish-eye images to equirectangular video.

Adapted from the example given for ffmpeg's RemapFilter, with support added for video captured with Ricoh Theta S devices.

Guide

Building

  1. Install ffmpeg, (make sure it's a recent version)
  2. Checkout the source of this repository
  3. Build: `$ gcc projection.c -lm -o project

Running

Create maps xmap.pgm and ymap.pgm for use with videos from Theta S devices:

$ ./project -x xmap.pgm -y ymap.pgm -h 960 -w 960 -c 1920 -r 960 -m theta --verbose

xmap ymap

This creates two ASCII encoded PGM files which act as a lookup table for ffmpeg to remap the video.

Apply the maps to the video R0014696.MP4:

$ ffmpeg -i R0014696.MP4 -i xmap.pgm -i ymap.pgm -q 0 -lavfi "format=pix_fmts=rgb24,remap" remapped.mp4

Known issues

The Lens mapping isn't perfect, I'm working on getting a more accurate mapping.

spinning camera stabilized wobble example

Stabilizing output videos via Hugin with Matthew Petroff's method reveals a wobble that would not be present if the mapping was perfect; Convieniently, I think i can use Hugin's Lens Calibration tools on the source frames to find a better mapping.

Useful Things for Spherical Video

Tag for upload

If you want to upload your video to youtube as a 360 video, make sure you encoded it as a .mp4, and use this tool from google. On linux, you can install python-tk and use the gui, or use it via command line.

The instructions there say to run python spatialmedia but there isn't anything called that, so replace spatialmedia with __main__.py and it works.

python __main__.py -i remapped.mp4 remapped_injected.mp4

Your file is now ready for YouTube/etc.

thetas-video-remap's People

Contributors

96fps avatar prouast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.