After days of getting my head around what best video qualities to use for these super stretched-out 360 videos and how to create one from my digital assets as well as what in the world FFmpeg was, and ultimately battling with my computers constantly overloaded hard drive, I have finally created my very own 4K resolution 360 interactive music video!
Now I’m writing down all of the steps that I used to reach this point for my own benefit as well as yours as I intend to be playing around with 360 video a LOT more! This is only the beginning of a beautiful journey…
First things first, I don’t have the money for a beautiful 360 camera to record my videos on; I know, boo-hoo, poor me! Instead I can use my knowledge of the digital-verse to my advantage and create all the assets I need from there! Ultimately I’d love to play around with creating 360 videos from animations that are specifically tailored for that medium; but let’s not get ahead of myself, first of all I need to know the basics of how to even get a video to render in 360 in the first place!
My weapons of choice were Maya, to create all of my 3D assets and make the little scene that my audience will be able to look around in! Originally I wanted to also use a 360 camera in Maya to render out the 360 video but I also really like what can be done with animating video and adding effects like smoke and other things easily within Unity3D so instead I decided to go with exporting my scene into Unity3D, replacing all of the textures and adding the necessary tweaks, such as rippling water on top of my underwater scene, lighting, and then animating the main camera slowly around so that it pans the area while the audience can have a good look around.
After creating all of this I then found this wonderful little tool from the Unity asset store called VR Panorama 360 Renderer which made my life 10x easier! It’s not free but I felt it was worth the £30 or so that I spent, this tool allows you to render out your camera animation as stereo 360 panoramas and 4k videos. I tweaked the settings to allow high quality and have the settings ready for YouTube (how to set these is all in the Readme file of the VR Panorama 360 Renderer, with inbuilt settings for 4k YouTube format), saving them out as an image sequence. Then was the dreaded wait while my laptop went berzerk, making all types of strange noises! I must have done this at least 5 times until I was happy with the desired video at the end, some of the images would end up corrupt because of my poor lil’ computer, but if you have a much better one then this shouldn’t be a problem, I just had to have my video a bit shorter than I wanted but I’ll work on this for next time!
Anyway, once the image sequence has been rendered then it’s time to use FFmpeg, and wow is this useful once you get your head around how to use it! If you don’t already know then look up a little on how to navigate around your computer using the command line, there’s loads of useful videos and documentation online.
Here’s the command that I used to do the magic and create my video ‘test.mp4’ (later renamed) from my folder of images that I just made.
Let’s start from the beginning: I didn’t use macports, like a lot of websites will suggest, to install FFmpeg, my computer didn’t have enough memory for all that jazz so I simply got the FFmpeg file and moved it somewhere that i could easily find it, in my home directory, and then referenced this when using it to make the new video.
With this in mind, watch this video that helped me greatly with how to do this. The number 25 related to how many frames per second and image2 simply means that it’s looking for image files. My start number is the number I wanted my video to start from within the image sequence, as I said my computer corrupted a bunch so I had to start from a little way in and then have this correlate down the images to create the file. These image files were all named as such: ‘img_00645.jpg’, ‘img_00646.jpg’, ‘img_00647.jpg’ and so on. Because of this we need to tell the computer that the image numbers are 5 digits wide and integers counting up, we do this by stating ‘%05d’ in between the image name, so overall it is ‘img_%05d.jpg’. The next part is to say what
This would have been easy peasy, if I hadn’t wanted to add audio along with it. Now, all I have to edit video is iMovie, have I explained that I have little money yet? So my initial thinking was to simply load the new video into iMovie, add my song over the top and then share it out as a new video. NOPE, NOPE, NOPE! iMovie automatically crops the video, meaning that it will work as a 360 video, but there will be a huge line appearing where the video can’t stitch together correctly because it’s been cropped. Now we have a problem….
So back with my learning of FFmpeg, as it turns out, it can also add audio to a video, perfect! Below is what I used to add the .mp3 file to the video file, for some odd reason though, this only seemed to work when I output a .mov file, but for the YouTube 360 Python script to work (which is the LAST STEP, don’t worry you haven’t missed anything) we need a .mp4 format. *Sigh* more work… It’s fine, we’ll get there eventually. This command didn’t work without using the ‘-map’ which states which source is the video and which is the audio. More on that here.
I’d like to stress now that I know there are some programs that I could use to convert these, and I did try multiple ones, attempting to make my life easier, but all they did was lower the quality considerably which actually made my life harder. By attempting to get my head around FFmpeg I was able to keep a high quality which is very important when uploading 360 videos as because it’s so wide and get wrapped around it will seem worse quality anyway, we want to import the video in as high a quality as possible so that it’s still enjoyable to watch!
With the audio and video merged into an mov file, all there was to do now was to export that again as an .mp4 file using FFmpeg again:
Gosh, nearly there! And the quality is still amazing which baffles me! So now I had to actually inject the piece of Python script that would make YouTube see this video as a 360 one. YouTube have a video on how to do this here. Watch the video and then follow the github link to see that it’s completely different layout than the original video helping you understand. Oh, the joys of the internet. So instead of downloading it, go into the releases tab and download the previous version before it got all fancy and updated, it still works fine.
Once this is downloaded you can follow the video step-by-step, putting the Python script in your home directory and running it on your video that you want to render as being 360 for YouTube:
Then upload and viola!!! It should work! If it doesn’t then be patient, mine took about 10 minutes after processing to actually become 360, all that time I was scratching my head and ready to cry but all I had to do was be patient! The video was even in 4k resolution as well, even after all those changes!
Okay so, I noticed that my song was a tad longer than the 360 video, which was fine because the video just stopped playing while my song trailed off to an end so it didn’t seem too abrupt or weird… But me being the silly perfectionist I am just needed to edit the video. I want a fancy fade in and a nice cut away at the end to round off the song. So I opened it back up in iMovie hoping to find a solution and BOOM! I realised that I could adjust the cropping… WHY DID I NOT THINK OF THAT IN THE FIRST PLACE?! The whole reason why I didn’t use iMovie was because it cropped the video but I can just manually have the whole video fit in the frame. What a numpty.
So after editing it how I liked I then exported it at the best quality that I could (high quality and 4k), took the same steps to add the python script to the .mp4 file and uploaded it to YouTube to see which video came out more crisp and clear.
And guess what, the iMovie video did come out as 4k as well it didn’t look as crisp as my original video at all, even when I watched them in Quicktime Player before uploading them I could tell a difference. You can have a look at the iMovie version but I have decided not to make it public. As well as this you can see a black circle where I have fitted the video to the iMovie editor, so I guess it wasn’t so simple after all!
Overall I’m very pleased with the outcome of my first 360 video. It’s well put together, showing no lines or seam edges and is probably the highest quality of video that I have on my entire YouTube channel! Now I just need to find a way for me to be able to edit the video and have full control over audio within the 360 video. I also want to experiment with putting videos inside of my 3d scenes, so it look someones perceptive of watching a television screen.
It hasn’t been easy but it’s sure been fun and I can’t wait to make more 360 videos! If you would like me to make one for you then do get in touch or if you want to come up with ideas about what we can create with this awesome medium then let’s chat!