How to Edit 360 Video in Davinci Resolve
Editing 360 Video Can Be Free & Easy — Here's How To DIY
Last month, my friend asked if I could edit together some 360 footage she recorded with her Samsung Gear 360. Though I'd never edited 360 video before, I took on the project. It was not nearly as complicated as I was expecting, and I even managed to accomplish it using all free software!
Here's the free software I used:
- Ricoh Theta V Basic App – a 360-viewer for video and image files.
- VLC – a non-360-viewer for video files.
- GIMP – to edit the images used in the intro-outro credits.
- DaVinci Resolve 14 – to edit and export 360 video files.
- Spatial Media Metadata Injector – to add 360 metadata to video files.
360 Video Project Description
My friend Torii Moré is Curator of Digita l Humanities at the McLean County Museum of History. Last summer, she recorded an hour-long walking tour in Bloomington, Illinois about how the city's progressive culture influenced Abraham Lincoln's political views. She wanted to release the 360 video for Lincoln's birthday. However, instead of recording one long video file, apparently the Gear 360 automatically starts a new video file after 11 minutes and 27 seconds, so she ended up with six separate video files that needed to be combined into one. She was also hoping to overlay some informative text at certain points during the video. With these goals in mind, I began some preliminary experimentation.
Early Experimentation with a Ricoh Theta S
After agreeing to the project, I borrowed a Ricoh Theta S from Illinois State University's Arts Technology Program (where I teach) and completed a Lynda.com course called Ricoh Theta Tips, Tricks, & Techniques lead by instructor Ben Long. (My local public library gives members free access to Lynda.com, so I even got to take this course for free!) Here are two fundamental lessons I took away.
Lesson #1: Dual-Fisheye vs. Equirectangular Video
I've learned that there are two common 360 video files: dual-fisheye, and equirectangular. Dual-fisheye is the raw, "unstitched" video taken by a 360 camera that has two fisheye lenses. It displays the captured footage as two separate circles. Below is an example of an "unstitched" dual-fisheye video I recorded during this experimentation phase.
In contrast to dual-fisheye, equirectangular video is when the two circles from a dual-fisheye video are "stitched" together into one rectangular video. Ben Long in his Lynda.com course said:
"[Equirectangular projection] is an ancient map projection, first formulated in the fourth century, so this is not something new that VR inventors have come up with. It's just a way of taking coordinate data and mapping it onto a flat space to represent a full 360 degrees. You may have even seen maps of the Earth done in this projection. It's not used so much for navigation because it's a pretty distorted perspective."
In other words, equirectangular projection is an old technique for turning the surface of a sphere into a rectangle. However since a 2D rectangle can't wrap perfectly around a 3D sphere, some severe stretching happens — especially near the top and bottom edges. (To learn more about the math behind converting dual-fisheye video into equirectangular video, click here.) The equirectangular example below is the result of "stitching" together the dual-fisheye example from above.
Note that neither of these are file types. What I mean by that is, there are no special file extensions for MyMovie.fish or MyMovie.equi or anything like that. Instead, they are more like video presentation styles. Your 360 video will still be a standard video file — such as an MP4 — but when you open it, the video itself will be presented in either dual-fisheye or equirectangular format.
Lesson #2: Edit Equirectangular Images with GIMP
Later in his Lynda.com course, Ben Long showed that you can edit equirectangular images as you would any other image. He demonstrated this by bringing one of his equirectangular JPGs into Photoshop, messing with its exposure and such, saving it as a new JPG, and then successfully opening the new image in the Ricoh Theta app. Torii asked if I could overlay some text onto her 360 footage, so I added text to one of my equirectangular JPGs using the free image manipulation program GIMP.
As you can see, if you place text directly over an equirectangular JPG, the 360 viewer naturally wraps the text around the space. This excited me, and I began to think this project wouldn't be as hard as I'd initially thought!
Starting the 360 Video Project
After my preliminary experimentation, Torii gave me six MP4 videos of the walking tour, which she took directly from her Gear 360's micro-SD card. I went home and found that the Ricoh Theta V Basic App would not open or convert these files. I tried opening the videos in Quicktime and got the error: The file isn't compatible with QuickTime Player. Finally I opened it in VLC and learned that the footage was in dual-fisheye format. (Praise be to VLC!)
Not knowing exactly what to do next, I watched this YouTube video by Sara Dietschy. Roughly two minutes in, she said that in order to edit the Samsung Gear 360 files on your computer, "the next step is transferring [the footage] to a Samsung phone." Since I didn't have a Samsung phone, I drove back to Torii and asked if she would follow Sara's instructions. We soon found out…
Lesson #3: Transferring Gear 360 Footage is a PAIN!
It turns out, transferring over an hour's worth of footage from a Samsung Gear 360 to a Samsung Galaxy is an excruciatingly painful process! Torii said it took two hours for each file, the phone and camera needed to stay plugged into a charger because it quickly drained both's batteries, and if she tried to use her phone for anything else during the process, the transfer would fail. (In Samsung's defense, if we were not working with a total of 22.32 gigabytes of data, I doubt the process would have been so painful.)
Although I didn't realize it at the time, this "transfer" process was using Torii's phone to "stitch" the raw dual-fisheye video into equirectangular video. This is why it took so long and drained her battery so quickly — it was partaking in a very CPU/GPU intensive process! After a few days of hard labor on Torii's end, I received the video files back, now as six equirectangular MP4s that would open in both the Ricoh Theta V Basic App and Quicktime Player.
In hindsight, I have learned that you might be able to convert the raw Gear 360 footage from dual-fish to equirectangular using a computer instead of transferring it to a phone. (Oh God Torii, forgive me!) This Cyberlink.com tutorial says that you should be able to convert the footage using this Gear 360 Action Director app. However, the app requires you to enter in the serial number of your Gear 360 before you can do anything, and I am not sure if you can use the same number across multiple computers. I'd hate to have gone this route and used Torii's serial number on my computer, resulting in her never being able to use the app on her computer. (Perhaps someone knows the answer to this and could help me out in the comments section?)
So why did we need to go through this process at all? The answer…
Lesson #4: Only Edit/Upload Equirectangular Video
While both the Ricoh Theta S and Samsung Gear 360 record video in dual-fisheye, it seems equirectangular projection is the standardized format for editing, viewing, and uploading 360 footage. As I showed in Lesson #2, you can easily edit equirectangular images using standard image manipulation programs like Photoshop or GIMP. This applies to video editing as well.
Another important point: Facebook and YouTube's 360 video viewers are made to work with equirectangular video — not dual-fisheye video. As an experiment, I tried uploading a raw Gear 360 dual-fisheye MP4 to both Facebook and YouTube, and neither of them recognized the video as 360:
As a further experiment, I injected 360 metadata into the same raw footage (which I will get to in Lesson #6) and again, Facebook and YouTube did not display the dual-fisheye properly:
Moral of this lesson: Convert your dual-fisheye videos to equirectangular videos as early as possible. It seems easier to edit, and it is the format that Facebook and YouTube are expecting you to upload.
Lesson #5: Edit 360 Video with DaVinci Resolve 14
Now that I had my equirectangular video files, I needed to edit them all together. To do that, I needed a video editor… and preferably one that's free! My awesome colleague in the Arts Tech Program suggested I try DaVinci Resolve 14, and it worked flawlessly. (Thanks Kristin!)
In order to edit 360 video in DaVinci Resolve 14, all you have to do is make sure that your project's resolution and export's resolution matches your 360 video's resolution.
Setting Up Your 360 Video Project in DaVinci Resolve 14
- Create a new project.
- Go to File → Project Settings…
- In the Timeline Settings, set the Timeline resolution to Custom, and enter in your equirectangular video's dimensions. (In my case, my video was 2560 pixels by 1280 pixels.) Also, adjust your frame rates if necessary.
Now you can import your equirectangular video files by going to File → Import Media…, add the files to your timeline, and then edit them as you would any other video. For my video, I added the intro-outro credits and text by using some simple keyframe automation of opacity levels.
Exporting Your 360 Video from DaVinci Resolve 14
- When you are ready to export, go to Workspace → Primary Workspace → Deliver.
- Under the Video tab, set your Format to MP4 and your Codec to H.264. (I think MOV files might also be compatible for 360 viewers, but MP4 is what I used.) You may also want to double check your frame rate.
- Under the File tab, pick whether you want your export's filename to use the Timeline name or a Custom name. I kept using custom names in order to keep track of the different versions of my exports.
- Click the Add to Render Queue button on the left side of the screen, then Start Render on the right side, and your 360 video will begin to export!
Important Note about 360 Video Length
For my project, I initially planned to compile all of the footage into one hour-long video. However I learned from this Facebook support page that Facebook requires all 360 video uploads to be less than 30 minutes long. Since YouTube didn't seem to have the same length limitation, I planned for four exports—a full-length export for Youtube, and parts one/two/three exports for Facebook. First, I tried to export the full-length 360 video for YouTube. I started the export, left it for two hours, and came back to the message: Failure occurred due to error: failed to encode the video frame. I searched around online and someone on this CreativeCow.net forum said, "normally we recommend breaking up projects in less than 20 minute chunks."
After talking with Torii, she recommended I break up the full-length video into six parts — one for each site of the tour. Although our deadline was quickly approaching and this change meant a bit more work for me, I knew it made the most sense. Cutting the full-length video into six parts meant each video would be well below the 30-minute upload limit for Facebook, I would be exporting "less than 20 minute chunks" from DaVinci Resolve 14, and I could cut out all of the walking from site to site as an attempt to keep motion sickness to a minimum. Also, I wouldn't need different exports for YouTube and Facebook; Torii said she would upload the six parts to YouTube as a playlist.
Now that I exported my edited equirectangular videos, it was time to inject some metadata!
Lesson #6: Inject 360 Video Metadata
As an experiment, I tried uploading my newly-exported equirectangular videos to Facebook and YouTube, but both sites hosted the video as if it were a standard 2D video.
I learned from this YouTube support page that, "Your video file needs to include certain metadata for 360° playback to be enabled." In order to add the appropriate metadata to your video, the support page said to download this free Spatial Media Metadata Injector app. (Click here to download the app for Mac and click here to download for Windows.) After you unzip and launch the app, you will be greeted by this adorably minimalistic interface:
Adding 360 Metadata with Spatial Media Metadata Injector
- Click the "Open" button, find the MP4 or MOV file you want to add 360 metadata to, and then click the second "Open" button. (Note that the Spatial Media Metadata Injector will only work with MP4 and MOV files.)
- Click the "My video is spherical (360)" checkbox.
- Click "Inject metadata", type in the name of the new media file, click "Save"… and that's it!
Upload your metadata-injected video file to Facebook or YouTube, and both websites will automatically treat it as a 360 video.
Congratulations!!! You've just edited and uploaded your 360 video! *\o/*
Adding 360 Metadata to Non-Equirectangular Video
Fun fact about this Spatial Media Metadata Injector: Facebook and YouTube will always treat your metadata-injected video as if it is an equirectangular video. However, that doesn't mean your video has to be equirectangular! You can run any MP4 or MOV of any dimension through this injector, and Facebook and YouTube will automatically treat it as a 360 video and stretch it around their 360 viewer. As an example of this, check out this Snapchat I took of a tree, both before and after I injected it with 360 metadata:
Lesson #7: 360 Video Workflow Tips
To close this article, I thought I'd share some miscellaneous workflow tips I discovered during this 360 video-editing journey.
- When adding text over a 2D equirectangular video in DaVinci Resolve 14, it is hard to tell exactly how the text will look within a 360 environment. To test this out, I would export a 5-to-10 second clip (to keep export times quick), then drag-and-drop the file into the Ricoh Theta V Basic App to view it in a 360 environment. This app automatically treats all videos and images as 360 files, so you do not need to inject any 360 metadata into the files first. I would view the text in the 360 environment, decide if any changes need to be made, go back and edit in DaVinci Resolve 14, and repeat this trial-and-error process.
- Initially I created six projects in DaVinci Resolve 14 — one for each "part" of the video series. However, if I decided to change the intro-outro credits, that meant I had to open each project individually to update the credits. Ultimately I ended up having one master project with all six parts of the series on the same timeline, but with large gaps between each. This allowed me to more easily copy+paste the credits from one part to the next, instead of having to open up new projects each time. When it came time to export, I would render the In/Out Range of each part instead of the Entire Timeline.
- When testing equirectangular exports in a 360 environment, I would always open the file in the Ricoh Theta V Basic App first, instead of hosting it directly to Facebook or YouTube. The Ricoh app opens the files quickly, while Facebook and YouTube may take a few minutes to upload and process the files. If the video looked good in the Ricoh app, I would then upload it to these websites to test how it appear online.
- When I wanted feedback from Torii, I would post the 360 video to my Facebook with my "Who can see this?" setting set to "Specific Friends" so only she could see it. I would then tag her in the post to make sure she received a notification about the upload. She would comment with feedback, and I'd revise based on her comments. We did this a lot!
- On Facebook, you can set the "initial perspective" for your 360 video. To do this, you must find the Edit Video option… which seems to be rather elusive. One method I've discovered is to find your 360 video upload in your timeline, fullscreen it so that you still have the recommendations sidebar, click the three dots on the top right, and then select Edit Video.
After you select Edit Video, if you scroll down you will find a 360 Video section that allows you to set the values for the following parameters:
- Initial heading (-180° to 180°) – Heading, also known as "yaw", can be thought of as turning-left-or-right.
- Initial pitch (-90° to 90°) – Pitch can be thought of as looking-up-or-down.
- Vertical field of view (40° to 120°) – Field of view can be thought of as zooming-in-or-out.
That's all I've got. I hope this helps! Let me know if you have questions, criticisms, or advice in the comments section.
If you liked this article and would like to be notified whenever I put out future content, please consider following my Medium account. Thank you!
How to Edit 360 Video in Davinci Resolve
Source: https://medium.com/@derickdowney/editing-360-video-can-be-free-easy-heres-how-to-diy-eb6a1d5f70c5
0 Response to "How to Edit 360 Video in Davinci Resolve"
Post a Comment