Skip to main content

Resolutions

Hyperserve supports converting uploaded videos to a list of resolutions in mp4 format.

Video conversion

Hyperserve is built to have maximum ease of use and minimum overhead at runtime. To achieve this you can choose what resolutions you want your video to be converted to in your create video api call. We support the following list of resolutions:

  • 144p
  • 240p
  • 360p
  • 480p
  • 720p
  • 1080p
  • 1440p
  • 4k
  • 8k
const formData = new FormData();

formData.append('file', videoFile);
formData.append('resolutions', '144p,240p,480p');
formData.append('isPublic', 'true');

fetch(`https://dev.api.hyperserve.io/api/video`, {
method: 'POST',
headers: {
  'X-API-KEY': YOUR_HYPERSERVE_API_KEY;
},
body: formData
});

Displaying video resolutions

The resolutions you select will create a seperate url to each resolution for the uploaded file. When you retrieve your video via the Get public video or Get private video apis, you will get an object that contains every resolution url associated.

data:{
...
variants :{
"144p": {
...
url: "some_url"
}
"240p":{
...,
url: "some_url"
},
"480p":{
...,
url: "some_url"
}
}
}

With this approach you can decide, at runtime, which resolution to use for a specific screen size in your presentation layer. Resulting in just the right amount of data transfer over the network, keeping your front end application lean and quick.