Use static MP4 and M4A renditions | Mux

Use static MP4 and M4A renditions

Create MP4 and M4A files from your assets with static renditions. Use these files for offline playback, social media cards, transcription services, and older devices.

This guide covers using static_renditions to create MP4 files, which replaces the deprecated mp4_support method. While mp4_support continues to function, we recommend using static_renditions for all new implementations.

For details on the older method, see enabling static mp4 renditions using mp4_support.

What are static MP4 and M4A renditions?

Static renditions are downloadable versions of your video assets in MPEG-4 video (.mp4) or audio (.m4a) format. These files are created alongside the default HLS streaming format and can be used for downloading or streaming the content.

Static renditions allow you to create downloadable files that can be used for:

It also allows users to download M4A audio files, which may be useful for:

In the majority of other cases, you'll want to use our default HLS (.m3u8) format, which provides a better viewing experience by dynamically adjusting the quality level to the viewer's connection speed. The HLS version of a video will also be ready sooner than the MP4 versions, if time-to-ready is important.

How video quality affects static renditions

Static renditions are created at the same quality level (Basic, Plus, or Premium) as your original Mux video, and will be the highest quality video rendition possible, a specific desired resolution, or an audio-only version. For videos with multiple versions at the highest resolution (which can happen with Premium quality), we'll use the highest quality version available.

How to enable static renditions

There are several points in an asset's lifecycle where you can enable static renditions. You can enable them when initially creating an asset, add them later to an existing asset, or configure them as part of a direct upload. The method you choose will depend on your workflow and when you determine you need the static renditions.

During asset creation

You can add static renditions to an asset when creating an assetAPI by including the "static_renditions": [] array parameter and specifying a { "resolution": <option> } object as an array element for each static rendition that should be created.

There are two types of static renditions: standard and advanced. Standard static rendition MP4s provide the most common options for needed for generating static renditions: either the highest video rendition possible, or an audio-only copy of the content. Advanced static rendition MP4s allow you to specify the specific resolution of the static renditions that are generated. Standard static renditions incur a cost for the number of minutes stored and delivered. Advanced static renditions also incur a cost per minute of MP4s that are generated.

Standard Static Rendition Options

The standard static renditions options are:

One or both options can be specified.

Advanced Static Rendition Options

The advanced supported resolutions are:

Mux will not upscale to produce MP4 renditions - renditions that would cause upscaling are “skipped”.

Note that advanced explicit resolution static renditions cannot be mixed with the highest standard static rendition. However, they can be generated on the same asset as the audio-only rendition.

After asset creation

You can add static renditions to existing assets retroactively by calling the create static rendition APIAPI, as shown below.

During direct upload

To enable static renditions for direct upload, you need to specify the same static_renditions field within new_asset_settings, as shown below:

During live stream creation

Static renditions can be created from the recorded version of a live stream. This is useful if you want to create downloadable files from a live stream soon after the live stream is finished.

If you want to enable static renditions from the recorded version of a future live stream soon after the live stream is finished, use the static_renditions property in the new_asset_settings when creating the live streamAPI.

After live stream creation

To update the static renditions that are configured to be created from the recorded version of a future live stream, use the update live stream static renditions APIAPI.

Access static renditions

After adding static renditions, you'll see an additional key on the asset object called static_renditions. Each static rendition appears as an entry in its files array, with its own id, status, type, and `resolution.

Static rendition status

Static renditions take longer to create than our default HLS version of the video, so they will not be ready immediately when the asset status is ready.

Each entry's static_renditions.files[].status refers to the current processing status of that individual static rendition. A static rendition is ready to use when its status is ready, at which point a video.asset.static_rendition.ready webhook is fired.

Remove static renditions

From an asset

To remove static renditions from an asset, you can use the delete static rendition APIAPI. You call the delete static rendition API with the id for each rendition to remove from the asset. The static rendition files will be deleted when they are removed from an asset.

To completely disable static renditions on an asset, delete all of the static renditions configured on the asset.

From future live streams

To remove the static renditions that are configured to be created from the recorded version of a future live stream, use the delete live stream static renditions APIAPI.

Webhooks

Your application can be automatically updated with the status of static renditions for an asset through webhooks.

There are five events you can receive, which can be fired for each individual static rendition.

Webhook Description
video.asset.static_rendition.created Emitted when a static rendition entry is created and the file is being prepared.
video.asset.static_rendition.ready Emitted when a static rendition is ready to be downloaded.
video.asset.static_rendition.errored Emitted when a static rendition fails to be generated.
video.asset.static_rendition.skipped Emitted when a static rendition is skipped because the requested resolution conflicts with the asset metadata. For example, specifying audio-only for a video-only asset or highest for an audio-only asset.
video.asset.static_rendition.deleted Emitted when an individual static rendition is deleted. Note: This event is not emitted when the parent asset is deleted.

Signed static rendition URLs

Mux videos have two types of playback policy, public or signed. If your playback_id is signed, you will need to also sign requests made for MP4 URLs.

You can check out how to do that in our signed URLs guide.

If you run into any trouble signing requests, please reach out to Mux Support and we'll be able to help.

Migrate from the deprecated mp4_support parameter

Previously, MP4 support was specified using the mp4_support parameter on an asset. This method continues to work though it has been deprecated and new functionality will use the static_renditions array.

To use the static_renditions array with assets that have MP4 support enabled using mp4_support, you need to first use the update asset MP4 support APIsAPI, setting mp4_support to none to remove the mp4_support. Then you can create the static renditions individually as described above.

Similarly, the mp4_support parameter cannot be used if an asset has existing static_renditions specified. Delete the static renditions and the legacy mp4_support parameter can be enabled.

Pricing

Additional storage fees apply for assets that have static renditions enabled.

Streaming of static renditions is charged at the same rate as HLS streaming.

See pricing documentation for full details