Dec 18, 2020
Catchoom Team
Augmented Reality SDK, video, video hosting
This article describes the best practices when adding video content to your Augmented Reality scenes in CraftAR. By taking into account some aspects described here you’ll provide users with a better experience by reducing latency and considering hardware limitations of mobile devices.
The article discusses the following sections:
In CraftAR you can create AR experiences with video contents. For this you need to provide a URL to a video file stored on a server and accessible from the Internet.
Before crafting such experiences we recommend uploading your video to a professional video hosting service. Our review of video hosting services provides guidelines to select services that work particularly well with CraftAR.
But if you simply want to perform a quick test with a video then you can use right now our video url that we prepared for testing: https://s3-eu-west-1.amazonaws.com/crs-beta-catchoom/contents/Catchoom/CraftAR-theUltimateARToolbox_cellular.mp4
IMPORTANT! You cannot provide links to public video sharing websites like YouTube.
We recommend using .mp4 videos (MP4 container) compressed with H.264 video (baseline profile) and AAC audio codecs. If your videos are in another format, we strongly recommend converting them in order to ensure support on a wide range of mobile devices. For learning about platform specific support you can read Android Supported Media Formats and best practices for deploying live streaming media for iPhone and iPad. Professional video hosting service often perform format conversions at the time of upload – see the instructions below. If you are hosting the videos on your own servers you can make the conversion using VLC multimedia player (free and cross-platform), or from command line using FFmpeg.
Most of the video hosting services expose links to video streams suitable for cellular networks (3G), and 4G or Wi-Fi (e.g. Vimeo’s SD.MP4 links). Note that currently CraftAR panel assumes the videos to have 16:9 aspect ratio (e.g. 640×360 pixels). When you are hosting videos on your own servers, or your hosting service enables defining the specific quality of the hosted videos, we recommend:
If your videos have a much higher bitrate than the recommended above, and the streaming is too slow, the instructions below will help you to reduce their bit rate.
Videos with transparency (also known as videos with alpha channel) refer to videos or animations that have a partial or total see-through background, which allows the user to see what is behind the video.
To know more about how we support videos with transparency in the CraftAR Service and in the SDKs, see how to add videos with transparency to Augmented Reality with CraftAR .
Vimeo is an easy to use service, that produces quality videos that work well with all CraftAR tools. Note that for commercial purposes you must be a Vimeo PRO user. Below we provide instructions for copying the video url from the Vimeo service. If for the moment you prefer to avoid creating a Vimeo account, try one of our own videos hosted at Vimeo and go directly to Step 3 in the instructions below.
Step 1: Create an account
Create an account at http://vimeo.com and login.
Step 2: Upload the video
Step 3: Copy the video link
If the Download button is not available, go back to “video settings->privacy” and ensure that “download the video” is checked and saved. Note: The above instructions were written on 2014-06-18. We will do our best to keep them updated.
Step 1: Install and launch VLC
We used version 2.1.4 (Rincewind) of VLC when writing those instructions. We recommend you to always use the latest version of VLC. We will do our best to keep the instructions updated.
Step 2: From the “File” menu, select “Convert / Stream”
Step 3: Choose the input video file via “Open media…”
Step 4: Click “Customize” in the section “Choose Profile” and set:
Step 5: Choose destination file and click “Save”
Step 1: Install FFmpeg
Follow the instructions from: https://www.ffmpeg.org/download.html We used version 1.2.4 of FFmpeg when writing those instructions. We recommend you always use the latest version of FFmpeg. We will do our best to keep the instructions updated.
Step 2: Conversion
Conversion command recommended for smartphones 3G: ffmpeg -i inputfile.avi -codec:v libx264 -profile:v baseline -preset slow -b:v 300k -vf scale=-1:360 -codec:a libfaac -b:a 96k output.mp4 Higher quality conversion recommended only for tablets with 4G: ffmpeg -i inputfile.avi -codec:v libx264 -profile:v main -preset slow -b:v 500k -vf scale=-1:360 -codec:a libfaac -b:a 128k output.mp4 Break down of the above parameters: