Published on May 8, 2024

Clip me, baby, one more time: Introducing instant clipping

Phil Cluff
By Phil Cluff7 min readProduct

About 2 years ago I walked into Mux HQ to record a marketing video for a new product we were announcing. I wandered over to our makeshift studio in the corner of the office to find Matt (one of our co-founders) standing in front of a green screen, wielding a pair of shears, clipping an imaginary hedge. He was also sporting quite the moustache.

Tragically, this advert never really saw the light of day. In the unaired version, the voiceover says "If only clipping your videos was this easy… in fact with the Mux Video API, it's even easier".

In this video, we were talking about our long-standing asset-based clipping feature, which lets you create new, accurately trimmed assets from any live stream or on-demand video asset. This feature is great for creating accurately trimmed media, but there are downsides: each new asset is charged for encoding, and clips can still take a little time to become available as they are processed as new assets.

Mux Video is built on a unique just-in-time (JIT) video processing architecture, which brings lots of benefits including allowing your videos to be available just a few seconds after upload. We also use this JIT-based processing to unlock lots of fun features on Mux Video, including all our playback modifiers, and today we're adding a new one: instant clipping.

Instant clipping allows you to set the start and end times of the streaming URL of an asset or live stream, to make clips that are instantly available without the wait time or expense of a new asset being created. This feature can be used to build lots of exciting new workflows, here are some features that we've already seen customers build using instant clipping:

LinkPre-live workflows

Sometimes you want to connect your contribution encoder to a live stream and test that the video is working end-to-end before you go live to your audience. But when you have DVR mode turned on for your stream, you don’t want to risk viewers being able to seek back into the parts of the live stream where your announcers are saying “testing, testing, 1… 2… 3…”, or even worse, a hot mic moment.

Instant clipping allows you to specify a start time to allow playback of a live stream, stopping users from seeking back into the stream beyond where you want. You can also specify an end time if you're worried about extra content at the end of your live events.

LinkPost-live trimming without re-encoding

With our long-standing clipping feature you’ve been able to create clipped on-demand assets, which are shortened versions of a given asset - this is commonly called “top and tail editing”. These assets always incur an encoding cost to process the clipped version, and can take some time to process.

Now, with instant clipping, for any asset generated from a live stream, you can simply specify the start and end times of the content you want clipped directly during playback without the need for timely and costly re-processing.

For example, if you’re a customer who broadcasts multiple sports events back-to-back on a single live stream, now you're able to make instant on-demand streams of each match as it ends for no extra cost.

LinkHighlight clips

Sometimes a really exciting moment happens on live streams, and you want to clip out a short highlight for others to enjoy — you can use instant clipping to pull out short clips from a currently active asset for promoting on your homepage or embedding into news articles.

Want to instantly show just the 90th-minute equalizer goal on your home page, while having extra time and penalties available to watch live on your pay-to-view platform? Well, now you can do so quickly and easily with instant clipping.

LinkHow does instant clipping work?

Every live stream or asset generated from a live stream contains a timestamp that is close (usually within a second) to the time that Mux received the source video from the contribution encoder. This timestamp is known as “Program Date Time” or “PDT” for short.

Author's note — "PDT” has nothing to do with the Pacific Daylight time zone; all times are represented in UTC or with unix timestamps… confusing, huh?

Instant clipping works by trimming the HLS manifests from live streams and VOD assets originating from live streams using these PDT timestamps, without re-encoding any segments. This means that Instant clipping operates at the segment level of accuracy, so you should expect that the content that you clip out may be several seconds longer than you’ve requested. We always make sure to include the timestamps that you request, but your content may start a few seconds earlier, and end a few seconds later. The exact accuracy depends on the latency settings of the live stream that you’re clipping from.

LinkUsing instant clipping

Instant clipping is super easy to use and is controlled by passing playback modifiers (query string arguments or JWT claims) to the playback URL of your live stream or asset. If you’re using signed URLs, these playback modifiers need to be embedded into your JWT.

The start and end time of your trimmed live stream or on-demand asset are specified by using the following two parameters:

Linkprogram_start_time

This parameter accepts an epoch time and can be set on a playback URL, and sets the start time of the content within the live stream or asset, for example:

Example using program_start_time
# Format https://stream.mux.com/${PLAYBACK_ID}.m3u8?program_start_time=${EPOCH_TIME} # Example https://stream.mux.com/sp9WNcgcktsmlvFLKgNm3jjSGRD00RPlq.m3u8?program_start_time=1707740400

When used on a live stream, this will cause the live stream to behave as if it is idle prior to this time.

When used on an asset, this will trim the start of the streamed media to this timestamp if needed.

Linkprogram_end_time

This parameter accepts an epoch time and can be set on a playback URL, and sets the end time of the content within the Live Stream or Asset, for example:

Example using program_end_time
# Format https://stream.mux.com/${PLAYBACK_ID}.m3u8?program_end_time=${EPOCH_TIME} # Example https://stream.mux.com/sp9WNcgcktsmlvFLKgNm3jjSGRD00RPlq.m3u8?program_end_time=1707740460

When used on a live stream, this will cause the live stream to behave as if it is idle after this time.

When used on an asset, this will trim the end of the streamed media to this timestamp.

LinkCombining parameters

These parameters can obviously be used together to extract a specific clip of a live stream or asset, for example:

Example combining parameters
# Format https://stream.mux.com/${PLAYBACK_ID}.m3u8?program_start_time=${EPOCH_TIME}&program_end_time=${EPOCH_TIME} # Example https://stream.mux.com/sp9WNcgcktsmlvFLKgNm3jjSGRD00RPlq.m3u8?program_start_time=1707740400&program_end_time=1707740460

As always, you can find full documentation on using instant clipping, including details on using it within Mux Player in our docs.

LinkChoosing between asset clipping and instant clipping

Not sure if you should be generating a new asset when clipping, or using instant clipping for your workflow? Here are some tips that can help you choose the right approach for your product.

Instant clipping is a great choice when:

  • You require a clip to be instantly available
  • You need the clips to not incur additional encoding fees
  • You need to pre-emptively limit the availability of content to build pre-live workflows for live streaming

You should use our asset-based clipping when:

  • You require frame accuracy in your clips
  • You require trimmed MP4s or masters

LinkFeedback

We’d love to hear your feedback as you experiment with the instant clipping feature, just drop us a message!

Written By

Phil Cluff

Phil has spent the last 10 years building some of the biggest AVOD, SVOD, and public service streaming platforms in the world at the BBC and Brightcove. He’s here to chew gum and stream video, and he’s all out of gum.

Leave your wallet where it is

No credit card required to get started.