The asset to calculate the bitrate for.
The size limit to shrink the asset to. Defaults to the OpenSea file size limit of 100 MB.
The minimum bitrate considered acceptable for the video. Defaults to 100kbps.
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.
The asset that will be transcoded.
The desired bitrate for the transcoded asset. Can be obtained from getDesiredBitrate to shrink an asset to a certain size.
The ffmpeg profile for the asset to be transcoded to.
Generated using TypeDoc
Utility function to calculate the bitrate that an asset should be transcoded to to fit within a specified size limit.
An exception will be thrown if the asset is so large that the necessary bitrate would fall below the specified
minBitrate
.