1. How to configure servers

The easiest way to stream video on demand (VoD) is to use progressive HTTP streaming which doesn't require any additional or special web server configuration. DeoVR player will download video header and based on this information will send HTTP Range requests to the web server in order to download necessary parts of the video file.

HTTPS is required to ensure compatibility with all Android versions.

Just upload your video files to the public folder of your Web Server and if you encoded your video right it should work without any additional server configuration.

There are 2 downsides of this method:
  • No seamless quality change based on a user internet speed
  • Users will be able to download your videos using a direct link.
2. Video encoding basics

There are quite a few different video and audio encodings available but not all of them you can use to play high-resolution VR video. All VR-ready PCs have hardware video decoding acceleration and it is a good idea to make use of it, more about it below. Set “Key Frame Distance” to 1-2 seconds, this will ensure good compromise between file size and smooth seeking.

There are simple rules you can follow to make sure that your customers will be able to watch your videos:

  • The most supported video codec today is H.264/MPEG-4 AVC, any VR-compatible PC can play it. Use it if you want maximum compatibility, you can use the same video file to stream your videos directly in users browsers. Select AAC audio encoding with a bitrate from 128k to 384k depending on your case and MP4 container format. It has limitations:
    • Maximum resolution hardware decoders can handle is 4096x4096 @ 30 FPS or 4096x2048 @ 60 FPS, do not exceed these constraints to ensure smooth playback for your users.
    • It requires more bitrate (internet bandwidth) to get the same visual quality than modern video codecs listed below.
  • More advanced video codec is H.265/HEVC, it provides the same visual quality at a lower bitrate than H.264 and NVidia GeForce GTX 10 Sires video cards can decode up to 8192x8192 @ 30 FPS with a built-in hardware video decoder and some mobile Exynos SoCs. Use the same audio settings and container format as for H.264 video codec. Limitations:
    • Browsers do not support this codec this means that you can not use it for direct web-browser streaming.
    • Windows 7 doesn’t support hardware accelerated video decoding for this codec.
    • Takes much longer to encode with software video encoder compared to H.264
  • VP9 is an alternative video encoder from Google, it is very close to H.265 in terms of video quality for the same bitrate and it is open source software. Use Vorbis audio codec and WebM container format. Limitations:
    • All Apple products don’t officially support it.
    • @TODO: Need to test hardware decoding/Codecs on Win 7 and Win 10

If you want to ensure that all your users will be able to watch your videos, you should provide several streaming options to them. The absolute minimum would be:

  • Original H.265 video in the highest resolution and framerate for high-end users.
  • H.264 4k video option for the maximum compatibility.
3. Intro to the integration

There are two ways to integrate DeoVR into the site.

A. Single video deeplink

A file .json with the description of one video is uploaded on the server. Then a button is added to the site. Once deeplink button is clicked, DeoVR launches and starts the video from this file. The video is played immediately.

B. Multiple videos selection
Called from DeoVR browser

Single .json file containing the list of videos is uploaded on the server. Then, in DeoVR “Internet browser” user calls the site (e.g. www.deovr.com) and gets access to the Selection Scene where they can choose a video from a list.

Called from a deeplink on the site

Single .json file containing the list of videos is uploaded on the server. Then a button with a deeplink to this file (e.g. “deovr://https://www.deovr.com/something.json”) is added to the site. By opening the site in a browser and clicking on the deeplink button, DeoVR launches and shows the user Selection Scene.

You can either implement just one integration, or both in the same time.

Important!
DeoVR saves settings for videos internally, title will be the title of the video, but if you want to send multiple videos with same title—use ID to distinct between them.

"title": "ExampleVideo"
"id": 555
1. Resolutions

Create a list of "videoSources". Set the URL and resolution for each video source.

"videoSources":
[
	{
		"resolution": 1080,
		"url": "C:/JsonExampleVideos/ExampleVideo_1080p.mp4"
	},
	{
		"resolution": 1440,
		"url": "C:/JsonExampleVideos/ExampleVideo_1440p.mp4"
	}
]
2. Video preview

You can add a video file which will be used to show the rewind of the file in the player.

"videoThumbnail":"https://yoursite.com/ExampleVideo_SeekLookUp.mp4"

The video should be in a low resolution as well as with low fps in order to save resources. In DeoVR for mobile devices this function may be unavailable.

3. Neccessary thumbnail and preview (optional) in case of playing from Selection Scene

In case of playing this video from the list, it is necessary to add the following lines:

"videoPreview":"https://yoursite.com/ExampleVideo_Preview.mp4"
"thumbnailUrl":"https://yoursite.com/ExampleVideo_Thumbnail.jpg"

The field ‘videoPreview’ contains the link to the video file, which is shown when moving the cursor to this video in the list. This field is not required.

The field ‘thumbnailUrl’ should contain the link to the file with the image shown in the list. This field is required in case of using the list.

4. Timestamps

Create a new list of "timeStamps". Each time stamp has time in seconds and a name value.

"timeStamps":
[
    {
        "ts": 15,
        "name": “Rabbit jumps”
    },
    {
        "ts": 30,
        "name": “Rabbit Sleeps”
    }
]

Important!
For correct work of timeStamps you should also specify length of the video in seconds, otherwise unnecessary.

"videoLength": 60
5. Corrections

Declare "corrections" and set horizontal ("x") or vertical ("y") offset [min -7.5, max 7.5], brightness ("br"), contrast ("cont") or saturation ("sat") values [min -70, max 70].

"corrections":
    {
        "x": 5,
        "y": -5,
        "br": -10,
        "cont": 10,
        "sat": 20
    }
6. Other

"stereoMode" can be set to "sbs" for side by side stereoscopic layout, "tb" for top-bottom layout or "off" for monoscopic videos.

"stereoMode": "tb"

"screenType" can be set to "flat" for a 2D quad display inside of VR, "dome" for 180° videos, "fisheye" for fisheye lens videos and "sphere" for 360° videos, “220” for 220° mesh and “250” for 250° mesh.

"screenType": "sphere"
7. Full JSON example
{
  "encodings":[
    {
      "name":"h264",
      "videoSources":[
        {
          "resolution":1080,
          "url":"https://yoursite.com/ExampleVideo_1080p.mp4"
        },
        {
          "resolution":1440,
          "url":"https://yoursite.com/ExampleVideo_1440p.mp4"
        },
        {
          "resolution":1920,
          "url":"https://yoursite.com/ExampleVideo_1920p.mp4"
        },
        {
          "resolution":2160,
          "url":"https://yoursite.com/ExampleVideo_2160p.mp4"
        },
        {
          "resolution":2880,
          "url":"https://yoursite.com/ExampleVideo_2880p.mp4"
        },
        {
          "resolution":3360,
          "url":"https://yoursite.com/ExampleVideo_3360p.mp4"
        },
        {
          "resolution":3840,
          "url":"https://yoursite.com/ExampleVideo_3840p.mp4"
        }
      ]
    }
  ],
  "title":"ExampleVideo",
  "id":123,
  "videoLength":60,
  "is3d":true,
  "screenType":"sphere",
  "stereoMode":"tb",
  "skipIntro":0,
  "videoThumbnail":"https://yoursite.com/ExampleVideo_SeekLookUp.mp4",
  "videoPreview":"https://yoursite.com/ExampleVideo_Preview.mp4",
  "thumbnailUrl":"https://yoursite.com/ExampleVideo_image.jpg",
  "timeStamps":[
    {
      "ts":15,
      "name":"Wall"
    },
    {
      "ts":30,
      "name":"Window"
    },
    {
      "ts":45,
      "name":"Door"
    }
  ],
  "corrections":{
    "x":5,
    "y":-5,
    "br":-10,
    "cont":10,
    "sat":20
  }
}

Important!
“is3d” should always be true, in case of false video will be forced monoscopic.

Json file contains the a collection of single videos (see Single Video Deeplink). You can create multiple scenes which will be displayed as the tabs below the interface in Selection Scene.

Json file should contain at least one scene. Each scene corresponds with its own list of videos. An example of list of scenes format:

{
   "scenes":[
      {
         "name":"Trailers",
         "list":[
            … description of video as in single video deeplink ...
         ]
      },
      {
         "name":"Full Videos",
         "list":[
            … description of video as in single video deeplink ...
         ]
      }
   ],
   "authorized":"0"
}

In that case, two scenes named «Trailers» and «Full Videos» will be created.

An example of a full file with one scene and two videos:

{
  "scenes":[
    {
      "name":"Library",
      "list":[
        {
          "encodings":[
            {
              "name":"h264",
              "videoSources":[
                {
                  "resolution":1080,
                  "url":"https://yoursite.com/ExampleVideo_1080p.mp4"
                },
                {
                  "resolution":1440,
                  "url":"https://yoursite.com/ExampleVideo_1440p.mp4"
                }
              ]
            }
          ],
          "title":"ExampleVideo1",
          "screenType":"sphere",
          "stereoMode":"tb",
          "skipIntro":0,
          "videoThumbnail":"https://yoursite.com/ExampleVideo1_SeekLookUp.mp4",
          "videoPreview":"https://yoursite.com/ExampleVideo1_Preview.mp4",
          "thumbnailUrl":"https://yoursite.com/ExampleVideo1_image.jpg",
          "timeStamps":[
            {
              "ts":15,
              "name":"Wall"
            }
          ],
          "corrections":{
            "x":5,
            "y":-5,
            "br":-10,
            "cont":10,
            "sat":20
          },
          "is3d":true,
          "videoLength":60,
          "id":123
        },
        {
          "encodings":[
            {
              "name":"h264",
              "videoSources":[
                {
                  "resolution":1080,
                  "url":"https://yoursite.com/ExampleVideo2_1080p.mp4"
                },
                {
                  "resolution":1440,
                  "url":"https://yoursite.com/ExampleVideo2_1440p.mp4"
                }
              ]
            }
          ],
          "title":"ExampleVideo2",
          "screenType":"sphere",
          "stereoMode":"tb",
          "skipIntro":0,
          "videoThumbnail":"https://yoursite.com/ExampleVideo2_SeekLookUp.mp4",
          "videoPreview":"https://yoursite.com/ExampleVideo2_Preview.mp4",
          "thumbnailUrl":"https://yoursite.com/ExampleVideo2_image.jpg",
          "timeStamps":[
            {
              "ts":15,
              "name":"Wall"
            }
          ],
          "corrections":{
            "x":3,
            "y":-3,
            "br":-5,
            "cont":5,
            "sat":10
          },
          "is3d":true,
          "videoLength":65,
          "id":234
        }
      ]
    }
  ],
  "authorized":"0"
}

If the list of videos is too big, you can use shortened format.
In this case, instead of all fields required for the video to be played, only four fields are used with an addition of the field ‘video_url’, which contains Json to the full description of each video (see Single Video Deeplink).

The required fields of shortened format:

  • thumbnailUrl - the address of the picture of the thumbnail;
  • title – the title of the video;
  • videoLength – the length of the video (in seconds);
  • video_url – the address of Json with the description of the video

Example:

{
  "scenes":[
    {
      "name":"Library",
      "list":[
        {
          "title":"Play with a pretty dog",
          "videoLength":79,
          "thumbnailUrl":"https://deovr.com/s/images/feed/thumb1.png",
          "video_url":"https://deovr.com/deovr/video/id/1"
        },
        {
          "title":"Bikini car wash",
          "videoLength":242,
          "thumbnailUrl":"https://deovr.com/s/images/feed/thumb2.png",
          "video_url":"https://deovr.com/deovr/video/id/2"
        },
        {
          "title":"Date with a girl",
          "videoLength":401,
          "thumbnailUrl":"https:\/\/deovr.com\/s\/images\/feed\/thumb3.png",
          "video_url":"https://deovr.com/deovr/video/id/2"
        }
      ]
    }
  ]
}
Choosing of .json file name for DeoVR

If you want your site to be accessible from DeoVR Browser with the link as «http://www.yoursite.com», put file ‘deovr’ (without extension and quotes) into the root directory of the server.
When following a link containing only domain name, DeoVR will request the data at the address «http://www.yoursite.com/deovr».
In case calling any other URL, e.g. «http://www.yoursite.com/video/test» the request will be made at the same link without changes. The result of the server response should be a .json with a list of video description.

Authorization in DeoVR

In case of transferring login, the result of server response should also contain field “authorized” with the following values:
1 — user is successfully authorized;
0 — user without an account;
-1 — authorization error.
In case of authorization error, DeoVR shows the following message: «Invalid login or password!».
If authorization is not used, the field is not required or its value should equal to 0.

In case of authorization attempt, the current link with .json file (both the list and the video) will be opened through POST request method. Fields ‘login’ and ‘password’ will respective data entered by user. The result of the authorization should be reflected in the field ‘authorized’ of .json described earlier.
In case of using authorization, ‘login’ and ‘password’ will be transferred to the requests of obtaining scenes, as well as to the requests of video description.