How is GCore video hosting organized?
Video Hosting refers to cloud storage of videos that are ready to be distributed and watched on end devices via the public internet. You can upload original video files in different formats, we process the videos in various ways, and we save the result to our internal storage. As a result, you get videos in HLS/MP4 format with subtitles, timeline previews, and other features available. You can upload videos to the storage via the Gcore Customer Portal or API. Learn how to add a video via the Gcore Customer Portal. Upload of videos via API can be done in three ways, which we describe in detail in this article. Quickly navigate to your chosen method here:- Copy from external storage
- Upload from a local device
- Batch upload to migrate a vast number of videos from other services
Video upload and processing statuses
When uploading a video to our storage and its processing, the file may have one of the following statuses:- Empty means the video entity has been created, but the origin video file has not yet been uploaded. In case of a long delay, check the “error” field for more details.
- Pending means the video is being processed; the original video file has been downloaded and submitted for processing.
- Viewable means the video is available for watching at least in 1 quality (but not in all qualities.)
- Ready means the video is ready and available in all qualities.
Copy from external storage
In the section, we explain how to copy and migrate files from a third-party, external storage to the Gcore Video Streaming. We will explain the process, offer an example API request, then explain how it works.Overview
If your videos are available by public HTTPS URL, this is the best option to copy video files directly from external storage. Available protocols for migration:- HTTP/HTTPS public access from external video hosting services, such as Vimeo or Mux
- HTTP/HTTPS public access from S3-like storages, such as AWS or Azure
- SFTP protocol
- Good link :
https://demo-files.gvideo.io/gcore.mp4
(13,8MB from S3 storage) - Good SFTP template :
sftp://login:password@domain.com/path/file.mp4
- Bad link (because of chunked HLS format):
https://demo-files.gvideo.io/hls/master.m3u8
origin_url
in the POST API request. The original video will be downloaded for Video Hosting on our server side.
Note : You can only upload one video per request.
Example of API request
Here is an example of the API request to set a task for copying a video from external storage:How it works
Here’s how it works on our end. We attempt to download a file three times, expecting a 200 OK response to access your provided link. If the download fails, the video entity will stay in the “Empty” status, and details will be added to the fielderror
. You need to delete the empty video entity and try to create a new one with the correct origin URL.
Once successfully uploaded and processed, the video will be available in the Customer Portal. You can check the status of the video by the GET API request or via webhook notifications.
Upload from a local device
When you develop your service, a video must be uploaded from the local host (your backend) or by users from a browser or mobile app. We use the TUS resumable upload protocol for uploading files, which works by cutting the video for upload into small segments and, if an interruption occurs, continuing from the point of interruption. The uploading process consists of three steps.Step 1. Create a video entity and get a video identifier
Specify the main parameters, and do not use theorigin_url
attribute in the POST API request.
Example of the request:
Step 2. Get TUS session parameters
To upload a file, you must get a TUS server URL and secret token. Specify the “id” parameter from step 1 and get the TUS session parameters. Example of the request:servers
: A list of available servers to upload the file; you can use any of them.token
: A secret token for starting the TUS session, valid for 4 hours which is long enough because as soon as the session starts, the token is no longer needed.video
: A copy of the main data pertaining to your video entity.
Step 3. Upload file via TUS chunked protocol
For uploading, use the session parameters taken from the previous step:chunksize
number is given in bytes. Take care to choose the chunk size appropriately:
- The larger the size of a chunk, the faster each chunk will be uploaded using the maximum bandwidth. But in the case of failure to upload, TUS will only start uploading from the last successful chunk, which may have been some time ago. So with large sizes, the speed will be faster, but if it fails, the additional reupload time will be significant.
- With small sizes, the risk of uploading errors decreases. However, due to the features of HTTP (handshakes, etc.) for each chunk’s request, the upload speed will significantly reduce. So small chunk sizes mean a slow but reliable upload speed.
InfoTransmitted data must comply with the rules for the Upload-Metadata header, including:
- Header fields must be comma-separated.
- All values are encoded using the Base64 scheme.
- All keys are unique.
token
, video_id
, and client_id
to find out the upload functionality of the TUS protocol:

- JS: We support 2.x version of tus-js-client, for details check out GitHub
- Android: Gcore’s open-source Kotlin demo app
- iOS: Gcore’s open-source Swift demo app
- Other implementation options can be found on the official TUS website
- HTTP 405 Method Not Allowed. Unexpected response while creating upload session; check parameters of the request.
- HTTP 429 Too Many Requests. Try to send a request later.
- HTTP 500 Internal Server Error :
- Error: token invalid (null) – check the format of parameters, encoding in base64, separation of parameters and key-value pairs.
- Error: token invalid (eyJhbGciOi…) – the same as above.
- Error: token video (12345) does not match this video (23456)
- Error: token client (123) does not match this client (234)
Batch upload to migrate a vast number of videos from other services
When moving a huge collection of video files, batch upload is the best method. This option will be available soon. Please ask our support team for details. We can help you to migrate from several storage types. We have compiled a list of storage types with instructions on how to get an HTTP link to access the file:- Google Drive
- Amazon S3 (step 1: Setting permissions for website access, step 2: Get the list of objects)
- Vimeo
- Mux
- Dropbox
- General SFTP or S3 storage with HTTP file access