Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • getDesiredBitrate(asset: Asset, sizeLimit?: number, minBitrate?: number): number | null
  • Utility function to calculate the bitrate that an asset should be transcoded to to fit within a specified size limit.

    remarks

    An exception will be thrown if the asset is so large that the necessary bitrate would fall below the specified minBitrate.

    Parameters

    • asset: Asset

      The asset to calculate the bitrate for.

    • sizeLimit: number = 100_000_000

      The size limit to shrink the asset to. Defaults to the OpenSea file size limit of 100 MB.

    • minBitrate: number = 100_000

      The minimum bitrate considered acceptable for the video. Defaults to 100kbps.

    Returns number | null

    The necessary bitrate for the asset to be shrunk or null if it already fits within the desired limit. Throws an exception if the asset can't be kept above minBitrate.

  • Creates the full ffmpeg profile specification for a given asset to be transcoded to the specified bitrate. Also picks an acceptable resolution based on the desired bitrate.

    Parameters

    • asset: Asset

      The asset that will be transcoded.

    • desiredBitrate: number

      The desired bitrate for the transcoded asset. Can be obtained from getDesiredBitrate to shrink an asset to a certain size.

    Returns FfmpegProfile

    The ffmpeg profile for the asset to be transcoded to.

Generated using TypeDoc