Skip to main content

On-the-Fly Packager (OTFP)

Overview

On-the-Fly Packager (OTFP) is a temporary video access mechanism designed to enhance the video encoding and packager experience by providing immediate playback of a video during its encoding process. This capability ensures a seamless workflow, offering users temporary access to the video through a playbackUrl as soon as the video is uploaded. Designed for short-term use, OTFP addresses the need for instant preview while maintaining secure handling of video assets.

OTFP Workflow and Functionality

  • Initiating OTFP:
    • Upon uploading a video, encoding begins automatically.
    • A request to assets\\{videoId} during this process will return a JSON response containing the playbackUrl.
  • Playback during Encoding:
    • The playbackUrl allows immediate streaming of the video ensuring seamless playback.
    • This URL facilitates previewing or using the video in workflows without waiting for the complete encoding process.
  • Callback and Completion:
    • Once encoding finishes, a webhook callback is triggered to the specified callBackUrl. This confirms that the video is ready for distribution or further processing.
    • The playbackUrl remains valid for a maximum of 24 hours from the moment the video was uploaded.
      • After recieving callback url or video encode completed webhook , update playbackurl with streamUrl of webhook, or (property in video encode callback), or playbackurl in video assets endpoint
  • Post-24-Hour Process:
    • The OTFP functionality is disabled after 24 hours, meaning that the playback link will no longer be functional.

Conditions for Enabling OnTheFly (OTFP)

The OnTheFly feature is enabled for content encoding when videos are uploaded in the VP player, provided the following conditions are met:

  • Codec Requirement:

    • The contentEncoding.Codec must be "h264". Other codecs are not supported.
  • Bitrate Requirements:

    • The contentEncoding.BitRate must fall within the allowed range:
      • Greater than or equal to minBitRate (100,000).
      • Less than or equal to maxBitRate, which varies based on the contentEncoding.Duration:
        • For durations less than or equal to 300 seconds: maxBitRate is 22,500,000 (22.5 Mbps).
        • For durations greater than 300 seconds but less than or equal to 600 seconds: maxBitRate is 17,500,000 (17.5 Mbps).
        • For durations greater than 600 seconds: maxBitRate is 12,500,000 (12.5 Mbps).
  • VP Player Requirement:

    • The video must be uploaded in the VP player.

If any of these conditions are not satisfied, such as the codec being unsupported or the bitrate falling outside the allowed range then OnTheFly feature will be disabled.

Best Practices for Using OTFP

  • Do Not Store the OTFP URL:
    • The playbackUrl is meant for immediate use and should not be cached or stored on backend systems for extended periods.
  • Integrate Promptly:
    • Utilize the temporary URL quickly within your application to avoid interruptions caused by its expiration.
  • Plan for Expiry:
    • Implement fallback mechanisms to handle cases where the playbackUrl is no longer available.