MP4 support for offline viewing
MP4 support with static renditions makes your video content widely accessible, easy to distribute, and compatible with diverse platforms and devices. Unlike adaptive streaming formats that adjust quality based on a viewer's connection, static MP4 files keep a consistent resolution and bitrate. This guide outlines the benefits of enabling MP4 renditions and provides a step-by-step approach to configuring MP4 support for your video assets.
Benefits of enabling MP4 support
-
Offline viewing
-
Use case: Users can download MP4 files to watch offline, which is especially useful in areas with limited or no internet access.
-
Benefit: Ensures video accessibility anytime, anywhere.
-
-
Legacy device compatibility
-
Use case: MP4 files support playback on older devices, including Android versions below 4.0.
-
Benefit: Provides broad device compatibility, avoiding exclusion of users on outdated devices.
-
-
Efficient for short videos
-
Use case: Ideal for videos under 10 seconds where fast, reliable playback is essential.
-
Benefit: Enhances user experience with smooth, quick access to short clips.
-
-
Social media embedding
-
Use case: MP4 files embed easily in Open Graph cards for sharing on social platforms like Facebook and Twitter.
-
Benefit: Simplifies social media sharing, boosting content reach and engagement.
-
-
Audio-only use cases
-
Use case: MP4 support can generate M4A audio files for podcasts, transcription services, and audio streaming.
-
Benefit: Expands functionality to audio-only content, making MP4 a versatile format for multiple media types.
-
Getting started with MP4 renditions
Step 1: Choose the right MP4 option
Select the MP4 support option that best suits your content needs:
-
capped_4k: Generates a single MP4 file up to a maximum of 1080p resolution.
-
audioOnly: Creates an M4A audio file.
-
audioOnly,capped_4k: Creates both M4A and MP4 files for media assets that include both video and audio.
Important
Selecting the correct MP4 option ensures your content is optimized for both video and
audio needs across platforms.
Step 2: Create or update a media file with MP4 support
To enable MP4 support when creating a new media file, follow these API request examples:
Create media (pull video from URL)
{
"inputs": [
{
"type": "video",
"url": "https://static.fastpix.io/sample.mp4"
}
],
"metadata": {
"key1": "value1"
},
"accessPolicy": "public",
"maxResolution": "1080p",
"mp4Support":"capped_4k"
}
Note
Replaceurl
with the source URL of your video. This request will generate an MP4 rendition capped at a resolution of 1080p.
Direct upload (push video)
For a direct upload from your local storage, you can use this configuration:
{
"corsOrigin": "*",
"pushMediaSettings": {
"metadata": {
"key1": "value1"
},
"accessPolicy": "public",
"maxResolution": "1080p",
"mp4Support": "capped_4k"
}
}
PLEASE NOTE
The mp4Support field should be set according to your desired configuration (e.g.,capped_4k
oraudioOnly
).
Accessing and using MP4 files
Once MP4 support is enabled, you can access the MP4 or M4A streaming URL by using the playback ID along with the file name specified in the static renditions section:
https://stream.fastpix.io/{PLAYBACK_ID}/{capped-4k.mp4, audio.m4a}
For example:
Video: https://stream.fastpix.io/{PLAYBACK_ID}/capped-4k.mp4
Audio: https://stream.fastpix.io/{PLAYBACK_ID}/audio.m4a
Tip: Use these links directly in media players or web pages to simplify playback and sharing options across various platforms.
Downloading mp4 video in Safari
Downloading mp4 video in Chrome
Updated 2 days ago