Garry's Mod

Garry's Mod

Not enough ratings
360° Video in GMod
By TheGamerBay
This guide describes the algorithm for creating panoramic video (360° video) in Garry's Mod.
   
Award
Favorite
Favorited
Unfavorite
Introduction
To create a panoramic video (360° video) - you need to record a sequence of 6 normal video with a different angle of rotation of the camera. It is necessary to synchronize the video in time and space. After this, you can to render a panoramic video by using a specialized software.
Install and Configure Bandicam
To record the video, you can use Bandicam[www.bandicam.com]



You can download this software under the following link: https://www.bandicam.com

After installation is complete, you must configure a fixed frame rate for video recording. To do this, activate the Video tab and click Settings in the Format section. This will open Format Settings:



Select MP4 for File Type and open FPS Settings:



And choose the option Prefer CFR - Constants Frame Rate

If this option is not selected, then the video can be recorded at different frame rates, and there will be problems with the rendering of the panoramic video.
Install Autopano Video
Now install Autopano Video[www.kolor.com]. This software to render panoramic video.



You can download this software under the following link: http://www.kolor.com/autopano-video/download/
Install and Configure 360 Assistant
To record a sequence of videos that are synchronized in time and in space - you need to subscribe to 360 Assistant

http://steamcommunity.com/sharedfiles/filedetails/?id=772461048
360 Assistant extends Catmull-rom Cinematic Cameras.

Once subscribed to the addon, run Garry's Mod. If Bandicam already running - it is better to close it! In the game press Q. On the right side of the screen select the Catmull-rom Cinematic Cameras tab. Then click on Camera Layout:



Here you must specify the key: Track Trigger Key. It must match the key that Start / Stop recording in Bandicam. In this case is F12.
The Trajectory of the Camera
The first step is to create a camera flyby trajectory. To do this - select the tool Catmull-rom Cinematic Cameras and left-click to set the point of the trajectory.



You must specify at least 4 points. Then press F12 and see the result.
Recording the Sequence of Video
Start Bandicam. Reopen Camera Layout and activate Enable 360° Recording:



Close Camera Layout and click F12. Camera will start moving and Bandicam will start recording video. You will see that this time, camera will have fixed direction. Once the motion is over - press F12 to stop recording.

Reopen the Camera Layout and set Recording Step to 2:



Close Camera Layout and start recording again. At this time, camera will turn 90 degrees relative to the previous step. Wait until the camera movement over and stop recording.

Repeat the same for Recording Step equal to 3, 4, 5 and 6.

As a result, you will get a sequence of 6 video files.

Prepare to Render Panoramic Video
Open folder in which Bandicam saves video. Inside the folder should be located six video files.



Rename video files to 1, 2, 3, 4, 5 and 6 according to their serial number in the list.



In this folder, create file gmod_template.pano with the following contents:

<?xml version="1.0" encoding="UTF-8"?> <pano> <layers> <layer name="N_0" ouput="1"> <images> <image index="0" preview="1" output="1"/> <image index="1" preview="1" output="1"/> <image index="2" preview="1" output="1"/> <image index="3" preview="1" output="1"/> <image index="4" preview="1" output="1"/> <image index="5" preview="1" output="1"/> </images> </layer> </layers> <images> <image> <def filename="1.mp4.jpg" focal35mm="50" lensModel="0" fisheyeRadius="0" fisheyeCoffX="0" fisheyeCoffY="0" speed="0" aperture="0"/> <camera model="0" yaw="0" pitch="0" roll="0" f="506.151" k1="0" k2="0" k3="0" offset_x="0" offset_y="0" fisheye_radius="1101.45" optimizationGroup="0"/> <color type="1" values="2.20 2.20 0.000000" version="2"/> </image> <image> <def filename="2.mp4.jpg" focal35mm="50" lensModel="0" fisheyeRadius="0" fisheyeCoffX="0" fisheyeCoffY="0" speed="0" aperture="0"/> <camera model="0" yaw="1.5708" pitch="0" roll="0" f="506.151" k1="0" k2="0" k3="0" offset_x="0" offset_y="0" fisheye_radius="1101.45" optimizationGroup="0"/> <color type="1" values="2.20 2.20 0.000000" version="2"/> </image> <image> <def filename="3.mp4.jpg" focal35mm="50" lensModel="0" fisheyeRadius="0" fisheyeCoffX="0" fisheyeCoffY="0" speed="0" aperture="0"/> <camera model="0" yaw="-3.14159" pitch="0" roll="0" f="506.151" k1="0" k2="0" k3="0" offset_x="0" offset_y="0" fisheye_radius="1101.45" optimizationGroup="0"/> <color type="1" values="2.20 2.20 0.000000" version="2"/> </image> <image> <def filename="4.mp4.jpg" focal35mm="50" lensModel="0" fisheyeRadius="0" fisheyeCoffX="0" fisheyeCoffY="0" speed="0" aperture="0"/> <camera model="0" yaw="-1.5708" pitch="0" roll="0" f="506.151" k1="0" k2="0" k3="0" offset_x="0" offset_y="0" fisheye_radius="1101.45" optimizationGroup="0"/> <color type="1" values="2.20 2.20 0.000000" version="2"/> </image> <image> <def filename="5.mp4.jpg" focal35mm="50" lensModel="0" fisheyeRadius="0" fisheyeCoffX="0" fisheyeCoffY="0" speed="0" aperture="0"/> <camera model="0" yaw="0" pitch="-1.57079" roll="0" f="506.151" k1="0" k2="0" k3="0" offset_x="0" offset_y="0" fisheye_radius="1101.45" optimizationGroup="0"/> <color type="1" values="2.20 2.20 0.000000" version="2"/> </image> <image> <def filename="6.mp4.jpg" focal35mm="50" lensModel="0" fisheyeRadius="0" fisheyeCoffX="0" fisheyeCoffY="0" speed="0" aperture="0"/> <camera model="0" yaw="0" pitch="1.57079" roll="0" f="506.151" k1="0" k2="0" k3="0" offset_x="0" offset_y="0" fisheye_radius="1101.45" optimizationGroup="0"/> <color type="1" values="2.20 2.20 0.000000" version="2"/> </image> </images> </pano>

Please note that if your videos have the extension avi (not mp4), then you need to replace all occurrences of .mp4.jpg to the .avi.jpg

Also please note that if your videos have the resolution differnet from 1920x1080, then you need to replace all occurrences of f="506.151" to the following values:

1280x720
f="340.294"
1360x768
f="361.562"
1920x1080
f="506.151"
Render Panoramic Video
Start Autopano Video, and import recorded video files by clicking Import videos.



After that activate Stitch tab. Select Template Panorama and click Stitch button:



The program will ask - what file to use as a template, you need to specify the path to the gmod_template.pano When stitching is completed - the program takes the following form:



After that activate Render tab.



And press Render. It will start rendering of panoramic video.



When rendering is finished you will get something like that:

Upload 360° Videos to YouTube
Your video file needs to include certain metadata for 360° playback to be enabled. Follow these instructions to install an app that will add the necessary metadata into a new file for you.

Create a 360-enabled file with an app
  • Download the 360 Video Metadata app for Mac[github.com] or Windows[github.com].

  • Un-zip the file, then open the 360 Video Metadata app. If you're on a Mac, you may need to right-click the app and then click Open.

  • Select the video file.

  • Select the checkbox for Spherical and click Save as. Do not select the "3D Top-bottom" checkbox. For more information, refer to upload instructions for virtual reality videos[support.google.com].

  • Enter a name for the file that will be created.

  • Save the file. A new file will be created automatically in the same location as the original file.

  • Upload the new file to YouTube.

  • Wait for the 360° effect to process. This may take a few minutes.

Source: YouTube Help[support.google.com]
Upload 360° Videos to Facebook
  • Follow the same steps as you would to add any other video to a Page[www.facebook.com]



  • Before publishing your video, click the Advanced tab



  • Then click to check the box next to This video was recorded in 360° format to make the 360 Controls tab appear.

  • Click the 360 Controls tab to be able to set the initial camera orientation and field of view for your video



  • Click Publish

Source: Help Center Facebook[www.facebook.com]
13 Comments
󠀡󠀡󠀡󠀡󠀡󠀡󠀡󠀡 May 29, 2022 @ 2:45am 
i am only wanna take 360 screenshot and how to do that?
Memo Mar 9, 2022 @ 2:36pm 
isnt there a way to record the player movement in 360?
TheUplinkExperiment Jan 18, 2021 @ 8:49pm 
Is there another thing like autopano, the company appears to be dead, and it needs a licence key
Mcrafteur62 Nov 19, 2020 @ 6:49am 
is there another program then autopano ? Autopano's company seems to have shutdown and it need a pro licence key.
MK Kahnivore Jun 30, 2020 @ 1:26pm 
Hi and thank you for this guide...like A LOT!
I've stumbled onto a roadblock, though.
Everything worked until the "select Panorama Template" part. -_-

I don't have that, it says; ".pano (select in folder)

when I select that and press Stitch it asks for the gmod_template
(which I've made following the instructions here)

but it can't find it.

I guess I did something wrong.

The file gmod_template.pano is just a text file with all that code in, right?

Anyways, hope this is not dead and hope to get a response. XD

greetings and thanks again!!
pickyroman Oct 8, 2018 @ 6:05am 
It doesn't work. :steamsad:
Daft Cat Dec 29, 2017 @ 8:14pm 
Why do not I see the option enable 360 recording?
TheGamerBay  [author] Oct 24, 2016 @ 3:02am 
Looks like gmod_template.pano work only with 1920x1080 You need to replace all occurrences of f="506.151" to the f="340.294"
Chen Buyi Oct 24, 2016 @ 2:00am 
1280*720
TheGamerBay  [author] Oct 24, 2016 @ 1:55am 
What resolution you use in GMod?