Upload 4K videos
Understanding 4K resolution
4K resolution refers to a horizontal display resolution of approximately 4000 pixels. The "K" in 4K stands for kilo (1000), indicating the approximate number of pixels. 4K resolution provides four times the number of pixels compared to traditional Full HD resolution, offering significantly greater detail and clarity.
With rapid advancements in technology, there has been a significant increase in user-generated content in 4K. This trend is not limited to professionally produced videos but also includes a growing amount of 4K content created by everyday users.
Using FastPix for 4K videos
FastPix video supports uploading, storing, and delivering on-demand video media files in high resolutions, including up to 4K. This ensures that your content maintains the highest quality possible for viewers.
Creating a 4K video with API
To effectively ingest, store, and deliver media in 4K resolution using FastPix, follow the steps below.
Creating a video from a URL
You can use the pull-based upload feature to retrieve and use public URLs from popular cloud file hosting services for uploading media. Instead of downloading large files to your local system, you can provide a direct URL, and FastPix will then pull the file from its location and begin processing it. Click here to read the detailed guide.
Endpoint: POST https://v1.fastpix.io/on-demand
Here’s an example of the request body:
{
"inputs": [
{
"type": "video",
"url": "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4"
}
],
"metadata": {
"key1": "value1"
},
"accessPolicy": "public",
"maxResolution": "2160p"
}
How it works:
- inputs: List of input sources, specifying the type (video) and the URL of the video file.
- metadata: Optional key-value pairs for additional information.
- accessPolicy: Defines the accessibility of the media, set to public.
- maxResolution: Sets the maximum resolution for encoding and delivery.
PLEASE NOTE
The default value for maxResolution is "1080p". To enable 4K resolution, set this parameters to "2160p". Keep in mind that setting a higher resolution can lead to higher billing costs.
Creating a video via direct upload from device
You can upload a video file directly from your local device to FastPix for processing and storage. By calling this API endpoint below with your preferred media settings, you will receive an uploadId and a pre-signed url in the response.
Endpoint: POST https://v1.fastpix.io/on-demand/uploads
Here’s an example of the request body:
{
"corsOrigin": "*",
"pushMediaSettings": {
"metadata": {
"key1": "value1"
},
"accessPolicy": "public",
"maxResolution": "2160p"
}
}
How it works:
- corsOrigin: Allows cross-origin resource sharing.
- pushMediaSettings: Contains the settings for the new media.
- metadata: Optional metadata for the media file.
- accessPolicy: Sets the media file policy to public.
- maxResolution: Default maximum resolution is "1080p". To use 4K, change this to "2160p".
IMPORTANT CONSIDERTATION
Resolution and billing: The
maxResolution
parameter dictates the highest resolution for encoding and delivery your media. By default, it is set to 1080p to avoid unnecessary high costs. To utilize 4K resolution, explicitly set the parameters to 2160p.This feature allows flexibility in resolution management, making it suitable for applications that require different video qualities, from standard HD to 4K.
Enabling and testing 4K playback with FastPix
FastPix uses Just-in-Time (JIT) encoding to ensure your media files, including 4K, are available as quickly as possible. When you enable 4K resolution for your media during ingestion, FastPix automatically adds 2K and 4K renditions to your HLS Playback URLs.
Here’s what you need to know to ensure smooth playback and optimal performance:
4K renditions and playback
- Automatic renditions: Once 4K is enabled, your assets will include 2K and 4K renditions. This allows users to access high-resolution content seamlessly.
- Codec and compatibility: FastPix uses high-bitrate H.264 for 4K content delivery. This codec is widely supported across many devices, ensuring broad compatibility.
Example of playback integration
<--video---> embed
Testing and validation
Device testing: Although we’ve rigorously tested playback and built robust device detection rules, it’s crucial to perform your own tests across your device footprint. This ensures compatibility and guards against unexpected playback failures.
Recommendation: Before widely enabling 4K playback on your playback, conduct thorough testing on various devices and network conditions to verify smooth performance.
Controlling 4K playback access with FastPix
Not all viewers may need access to 4K content, and many streaming platforms reserve 4K playback for their higher subscription tiers. You can manage playback resolution using the maxResolution query parameter in your playback URLs. Here’s how:
Implementing resolution control
To restrict playback resolution, add the maxResolution query parameter to your HLS playback URL. This allows you to specify the maximum resolution for each user based on their subscription tier.
Example URL
https://stream.fastpix.io/${PLAYBACK_ID}.m3u8?max_resolution=1080p
How it works:
PLAYBACK_ID: Replace ${PLAYBACK_ID} with the unique identifier for your video asset.
maxResolution: Set this parameter to the desired resolution (e.g., 1080p, 720p, 480p). For 4K content, use 2160p.
Streaming 2K and 2.5K content
FastPix also supports 2K and 2.5K (1440p) content. To process a media file as 2K or 2.5K, set the maxResolution parameter to "1440p" in both the Create media using URL (pull video) and Direct upload (push video) methods.
Here are the request body examples:
Create Media from URL
{
"inputs": [
{
"type": "video",
"url": "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4"
}
],
"metadata": {
"key1": "value1"
},
"accessPolicy": "public",
"maxResolution": "1440p"
}
Direct upload
{
"corsOrigin": "\*",
"pushMediaSettings": {
"metadata": {
"key1": "value1"
},
"accessPolicy": "public",
"maxResolution": "2160p"
}
}
Updated 2 days ago