You can combine a base video with additional video segments (also called video splicing) by defining specific insert timestamps or appending them at the end. This programmatic approach is ideal for building dynamic, automated video workflows - like generating post-game highlight reels, assembling personalized video feeds, or combining pre-roll and mid-roll content into a single video.
To stitch videos together, you can use both the create media from URL or upload media from device API endpoints.
All requests must be authenticated using HTTP Basic Auth with your FastPix Access Token and Secret Key.
See basic authentication guide to get your credentials.
NOTE
- The resolutions for video segments should be greater than or equal to the base video as FastPix does not support upscaling.
- The frame rate of the video segments should be similar to the base video frame rate.
To stitch a video, define the base media file in the url field and provide an array of segments inside the segments field. Each segment must be a separate media file.
Use insertAt for specific timestamps (in seconds), or insertAtEnd: true to append to the end of the base video.
FastPix processes the entire input and returns a new stitched video asset with a unique media ID and playback ID. The stitched media preserves all base media settings along with all segments added at their specified positions.
To stitch a media using a JSON request:
a. Create a new media from URL or directly upload it from the device.
b. Stitch segments in existing media
NOTE
You must specify either
insertAtorinsertAtEnd, but not both, for each segment.Use the URL which is generated after uploading video to FastPix dashboard.
The resulting stitched media preserves all base media settings and then generates a new video with all segments added at their specified positions.
The process for stitching video segments from media uploaded from a device is similar to stitching segments from media created using a URL. The only difference is that instead of using a base video URL, you must use the mediaId of the existing media with the fp_mediaId:// prefix.
NOTE
A new media always gets created when video segments stitched to an existing media.
A successful request returns a stitched media asset with its own unique media ID and a list of playback IDs. You can now stream the new stitched video using the provided playback ID.
You can register a webhook to receive an event when stitching is complete. How to setup webhooks?
Event: video.media.splicing.ready