Code Monkey home page Code Monkey logo

takashiyoshinaga / iphonecinematicdepthto3d Goto Github PK

View Code? Open in Web Editor NEW
32.0 4.0 3.0 154.95 MB

This is a sample C# project that extracts Depth and Color information from videos shot in iPhone's Cinematic mode and outputs each as separate videos, along with a sample Unity project for 3D playback of these videos.

Home Page: https://vizyoshinaga.sakura.ne.jp/en/

License: MIT License

C# 71.52% HLSL 20.10% ShaderLab 8.17% GLSL 0.21%
cinematic depth-map iphone looking-glass volumetric-video unity

iphonecinematicdepthto3d's Introduction

iPhone CinematicDepth To 3D

1. Overview

This is a sample C# project that extracts Depth and Color information from videos shot in iPhone's Cinematic mode and outputs each as separate videos, along with a sample Unity project for 3D playback of these videos.

This sample consists of three projects:

  • DepthExtractor:
    A C# sample project for separating Depth and Color from videos shot in Cinematic mode.
  • DepthPlayer:
    A Unity sample project to display Depth and Color videos in 3D.
  • DepthPlayer_LKG:
    A Unity sample project to display Depth and Color videos in 3D using Looking Glass.

2. Cinematic Mode Compatibility

Refer to Apple Support.
Additionally, the iPhone 15 Series is compatible.

3. iPhone Settings

Camera Settings

  1. Settings -> Camera -> Formats
  2. Choose "High Efficiency" under the Camera Capture section

File Transfer Settings

  1. Settings -> Photos
  2. Select "Keep Originals" under the TRANSFER TO MAC OR PC section

4. Transfer Video Files to PC

[USB Transfer]

For Windows

  1. Connect the iPhone to your PC with a USB cable
  2. Using Explorer, locate the cinematic video you wish to use
  3. Copy it to any folder on your PC
    Note: When shooting a video, filenames like IMG_0001.MOV and IMG_E0001.MOV might be generated. Make sure to select files without the "E", such as IMG_0001.MOV.

For Mac

  1. Connect the iPhone to your Mac using a USB cable
  2. Launch the Photos app on your Mac
  3. Choose "iPhone" from the list on the left side of the window
  4. Select the video you wish to import and click the Import button
  5. Choose "Imports" from the list on the left side of the window
  6. From the menu bar at the top, select File -> Export
  7. Click on "Export Unmodified Original for 1 Video"
  8. Hit the Export button
  9. Save to your desired folder

[Network Transfer (iOS 17 and above)]

  1. Launch the Photos app on your iPhone
  2. Select the cinematic video and tap the Share button
  3. Tap "Export Unmodified Original"
  4. Select a destination folder and tap the Save button
  5. Open the Files app
  6. Share the video saved in step 4 as you see fit, e.g., through Google Drive.

5. Separating Depth and Color Videos (Windows Only)

  1. Navigate to the DepthExtractor_Win folder
  2. Start DepthExtractor.exe from the Executable folder or run the project in the Project folder using Visual Studio
  3. Click the Open button and select a cinematic video
  4. Hit the Convert button and wait for "Done" to be displayed
  5. color_output.webm and depth_output.webm will be generated in the same directory as the video you selected in step 3.
    Note: The depth video size is either 512x288 or 288x512, while the color video size is 512x512.

6. Display in 3D within Unity

  1. Open the DepthPlayer or DepthPlayer_LKG project in Unity
  2. Place color_output and depth_output into any directory under the Assets folder
    e.g., within the VideoFiles directory
  3. Double-click on DepthPlayer inside the Scenes directory
  4. In the Hierarchy, select the [Main] object
  5. Drag & drop color_output onto "Color Video" in the Inspector
  6. Drag & drop depth_output onto "Depth Video" in the Inspector
  7. At the top of the UnityEditor, click the Play button
    Note 1: To change the display size, position, or angle, please modify the Transform parameters of the [DepthMeshRoot] object.
    Note 2: To adjust only the depth direction scale, you can modify the Depth Scale value (Default=1.5) of the [Main] object. Note 3: To change viewpoints, please use the Scene View. Viewpoint control within the Game View have not been implemented.

7. License

While this sample is under the MIT License, be aware of the following dependencies and their respective licenses:

8. Acknowledgements

In the development of Depth Extractor, the trial and error results by Jan Kaiser proved to be invaluable.
You can see the details in this tweet.

9. Feedback

Feel free to provide feedback on my project via social media. I appreciate your insights and comments.
Connect with me on X (Well know as Twitter) @Tks_Yoshinaga.

iphonecinematicdepthto3d's People

Contributors

takashiyoshinaga avatar

Stargazers

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

Watchers

 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.