All Projects → imgntn → J360

imgntn / J360

360 Video and Photo Capture in 4K for Three.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to J360

Encom Boardroom
📈 Web tribute to the Tron: Legacy Boardroom Scene
Stars: ✭ 2,094 (+730.95%)
Mutual labels:  webgl, threejs
Gpu Physics.js
GPGPU physics for Three.js
Stars: ✭ 246 (-2.38%)
Mutual labels:  webgl, threejs
Threejs Modern App
Boilerplate and utils for a fullscreen Three.js app
Stars: ✭ 176 (-30.16%)
Mutual labels:  webgl, threejs
Threejs Path Flow
🐬🐟 ↶Mesh Deformation / Bending / Following on a Curve
Stars: ✭ 165 (-34.52%)
Mutual labels:  webgl, threejs
Magicshader
🔮 Tiny helper for three.js to debug and write shaders
Stars: ✭ 205 (-18.65%)
Mutual labels:  webgl, threejs
React Globe
Create beautiful and interactive React + ThreeJS globe visualizations with ease.
Stars: ✭ 167 (-33.73%)
Mutual labels:  webgl, threejs
Three Nebula
WebGL based particle system engine for three.js
Stars: ✭ 192 (-23.81%)
Mutual labels:  webgl, threejs
Stickyimageeffect
A sticky image effect for a slideshow inspired by ultanoir's website.
Stars: ✭ 158 (-37.3%)
Mutual labels:  webgl, threejs
Demos
One repo to rule them all.
Stars: ✭ 204 (-19.05%)
Mutual labels:  webgl, threejs
Droneworld
droneWorld: a 3D world map and a three.js playground
Stars: ✭ 197 (-21.83%)
Mutual labels:  webgl, threejs
Threejs Sandbox
Set of experiments and extensions to THREE.js.
Stars: ✭ 163 (-35.32%)
Mutual labels:  webgl, threejs
Pathfinding Visualizer Threejs
A visualizer for pathfinding algorithms in 3D with maze generation, first-person view and device camera input.
Stars: ✭ 209 (-17.06%)
Mutual labels:  webgl, threejs
Vue Displacement Slideshow
A Vue.js 2.0 slideshow component working with Three.js
Stars: ✭ 165 (-34.52%)
Mutual labels:  webgl, threejs
Expo Voxel
🎮🌳 Voxel Terrain made in React Native. ∛
Stars: ✭ 169 (-32.94%)
Mutual labels:  webgl, threejs
Patches
Patches is a visual programming editor for building WebVR and WebGL experiences.
Stars: ✭ 164 (-34.92%)
Mutual labels:  webgl, threejs
Aframe Effects
A VR Ready Post processing framework for Three.js and/or A-Frame
Stars: ✭ 176 (-30.16%)
Mutual labels:  webgl, threejs
Wechart
Create all the [ch]arts by cax or three.js - Cax 和 three.js 创造一切图[表]
Stars: ✭ 152 (-39.68%)
Mutual labels:  webgl, threejs
Texture Compressor
CLI tool for texture compression using ASTC, ETC, PVRTC and S3TC in a KTX container.
Stars: ✭ 156 (-38.1%)
Mutual labels:  webgl, threejs
React Three Next
React Three Fiber, Nextjs, Tailwind starter
Stars: ✭ 195 (-22.62%)
Mutual labels:  webgl, threejs
Forgejs
ForgeJS is a javascript framework that unleashes immersive WebVR experiences.
Stars: ✭ 207 (-17.86%)
Mutual labels:  webgl, threejs

This project shows how to export 4K resolution 360 Videos and Photos from inside of Three.js scenes.

The process is described in this blog post: https://medium.com/p/788226f2c75f

Examples

example 4k video from demo scene on YouTube

Alt text

example 4k test video on YouTube

Alt text

How this works

Basically you take a cube camera, save it to equirectangular photo, and then stitch those together to make a video. Add some metadata and voila! You can then post them to Facebook and Youtube.

I made some modifications to the CCapture.js library, where I added a CC360Encoder class that calls into an cubemap to equirectangular image capture library from the same author. I made modifications to that library also, where I prepare the cube camera data for the encoder with the preBlob class. Finally, I was running into memory issues very quickly, so I re-implemented the broken batching in CCapture.js for .jpg sequences.

The app will capture a batch every N seconds, according to the autoSaveTime parameter. Save and unarchive these .tar files, then use FFMPEG to stitch the images together. See the post on Medium for more about metadata.

Try Online

demo scene

simple tests

Example files

Clone the repository and serve its files using a webserver of your choice.

index.html contains simple test shapes. moving the camera during capture has no effect.

demo.html is hacked into a three.js demo scene. moving the camera during capture will change the final shot.

Use it yourself

Include the modified CCapture.js and CubeMapToEquirectangular.js libraries. You'll need tar.js and download.js as well. Which controls to include are up to you.

Instantiate a capturer. Batches will download automatically every N seconds according to the autoSaveTime property.

// Create a capturer that exports Equirectangular 360 JPG images in a TAR file
var capturer360 = new CCapture({
    format: 'threesixty',
    display: true,
    autoSaveTime: 3,
});

Add a managed CubemapToEquirectangular camera when you setup your scene.

Here we use “4K” but you can also use “2K” or “1K” as resolutions.

equiManaged = new CubemapToEquirectangular(renderer, true,"4K");

Call the capture method at the end render loop, and give it your canvas.

capturer360.capture(canvas);

These functions will start and stop the recording.

function startCapture360(event) {
    capturer360.start();
}

function stopCapture360(event) {
    capturer360.stop();
}

Unarchive, Convert, and Add Metadata

Unarchive the .tar files to a single folder and then convert the whole folder of images into a movie with one FFMPEG command

ffmpeg -i %07d.jpg video.mp4

The “%07d” tells FFMPEG that there are 7 decimals before the “.jpg” extension in each filename.

In tests of a 30 second capture, I've seen a 1.66GB folder of 4K 360 images compress into a single 3.12mb 4K 360 video. A lot depends on how much movement there is in the scene, but the reductions are dramatic.

Then use the Spatial Media Metadata Injector to add spatial metadata and upload.

Contact

Get in touch with me on LinkedIn for custom 360 content or more versatile deployments of this software.

https://www.linkedin.com/in/jamespollack

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].