FetchVideoSource
class FetchVideoSource extends VideoSource
Defines how to manipulate a fetched video layer.
Learn more: Video overlays
Methods
Change the size of the image exactly to the given width and height without necessarily retaining the original aspect ratio: all original image parts are visible but might be stretched or shrunk.
Custom resize builder.
Applies delivery action.
Deliver the image in the specified device pixel ratio.
Delivers the image as an attachment.
Adds ICC color space metadata to the image, even when the original image doesn't contain any ICC data.
Instructs Cloudinary to clear all image meta-data (IPTC, Exif and XMP) while applying an incoming transformation.
Returns metadata of the input asset and of the transformed output asset in JSON instead of the transformed image.
Sets the cache-control to immutable for the asset.
Keeps the copyright related fields when stripping meta-data.
Keeps all meta-data.
Instructs Cloudinary to clear all ICC color profile data included with the image.
Inject a custom function into the image transformation pipeline.
Applies a filter or an effect on an asset.
Applies adjustment effect on an asset.
Applies a pre-defined named transformation of the given name.
Adds a generic qualifier as a separate action.
Adds action defined as an array of qualifiers.
Adds a flag as a separate action.
Rotates the asset by the given angle.
Specifies a conditional transformation whose condition should be met before applying a transformation.
Don't stream a video that is currently being generated on the fly. Wait until the video is fully generated.
Causes the video download to begin immediately, streaming it as a fragmented video file.
Deliver an HLS adaptive bitrate streaming file as HLS v3 instead of the default version (HLS v4).
Keep the Display Aspect Ratio metadata of the uploaded video.
Convert the audio channel to mono.
Truncate (trim) a video file based on the start time defined in the metadata.
Create a waveform image (in the format specified by the file extension) from the audio or video file.
Trims a video (and discards the rest).
Rounds the corners of a video.
Adds another video, text, image as an overlay over the container video.
Applies the video as a cutter for the main video.
Adds subtitles to the video.
Transcodes the video (or audio) to another format / adjusts encoding properties.
Controls the range of acceptable FPS (Frames Per Second) to ensure that video (even when optimized) is delivered with an expected fps level (helps with sync to audio).
Explicitly sets the keyframe interval of the delivered video.
Controls the video bitrate.
Sets the streaming profile to apply to an HLS or MPEG-DASH adaptive bitrate streaming video.
Sets the total number of frames to sample from the original video.
Applies the specified video edit action.
Adds another video layer.
Adds another video layer from a remote URL.
Adds subtitles to a video.
Adds another audio layer.
Adds another image layer.
Adds another image layer.
Applies a look-up table (LUT) file to the image.
Adds a text layer.
VideoLayer constructor.
Sets the source of the layer.
Details
TransformationResizeTrait
resize(BaseResizeAction $resize)
Resize the asset using provided resize action
TransformationResizeTrait
scale(int|float|string|null $width = null, int|float|null $height = null, int|float|array $aspectRatio = null)
Change the size of the image exactly to the given width and height without necessarily retaining the original aspect ratio: all original image parts are visible but might be stretched or shrunk.
TransformationResizeTrait
crop(int|float|string|null $width = null, int|float|null $height = null, Gravity $gravity = null, int|float|X $x = null, int|float|Y $y = null)
Extracts a region of the given width and height out of the original image.
TransformationResizeTrait
fill(int|float|string|null $width = null, int|float|null $height = null, Gravity $gravity = null)
Creates an image with the exact given width and height without distorting the image.
This option first scales up or down as much as needed to at least fill both of the given dimensions. If the requested aspect ratio is different than the original, cropping will occur on the dimension that exceeds the requested size after scaling.
TransformationResizeTrait
genericResize(string $name, int|float|string|null $width = null, int|float|null $height = null)
Custom resize builder.
TransformationDeliveryTrait
delivery(mixed $delivery)
Applies delivery action.
TransformationDeliveryTrait
format(Format|string $format)
Forces format conversion to the given format.
(Formerly known as fetch format)
TransformationDeliveryTrait
quality(int|string|Quality $quality)
Controls compression quality. 1 is the lowest quality and 100 is the highest.
Reducing the quality is a trade-off between visual quality and file size.
TransformationDeliveryTrait
dpr(float|string $dpr)
Deliver the image in the specified device pixel ratio.
CommonTransformationFlagTrait
attachment(string $filename = null)
Delivers the image as an attachment.
CommonTransformationFlagTrait
forceIcc()
Adds ICC color space metadata to the image, even when the original image doesn't contain any ICC data.
CommonTransformationFlagTrait
forceStrip()
Instructs Cloudinary to clear all image meta-data (IPTC, Exif and XMP) while applying an incoming transformation.
CommonTransformationFlagTrait
getInfo()
Returns metadata of the input asset and of the transformed output asset in JSON instead of the transformed image.
CommonTransformationFlagTrait
immutableCache()
Sets the cache-control to immutable for the asset.
CommonTransformationFlagTrait
keepAttribution()
Keeps the copyright related fields when stripping meta-data.
CommonTransformationFlagTrait
keepIptc()
Keeps all meta-data.
CommonTransformationFlagTrait
stripProfile()
Instructs Cloudinary to clear all ICC color profile data included with the image.
TransformationCustomFunctionTrait
customFunction(CustomFunction $customFunction)
Inject a custom function into the image transformation pipeline.
CommonTransformationTrait
effect(EffectQualifier|EffectAction $effect)
Applies a filter or an effect on an asset.
CommonTransformationTrait
adjust(EffectQualifier|EffectAction|AdjustmentInterface $adjustment)
Applies adjustment effect on an asset.
CommonTransformationTrait
namedTransformation(string|NamedTransformation $transformationName)
Applies a pre-defined named transformation of the given name.
CommonTransformationTrait
addGenericQualifier(string $shortName, array|mixed ...$value)
Adds a generic qualifier as a separate action.
CommonTransformationTrait
addActionFromQualifiers(array $qualifiers)
Adds action defined as an array of qualifiers.
CommonTransformationTrait
addFlag(FlagQualifier|string $flag)
Adds a flag as a separate action.
CommonTransformationTrait
addVariable(string|Variable $name, mixed $value = null)
Defines an new user variable.
CommonTransformationTrait
rotate(string|int $angle)
Rotates the asset by the given angle.
CommonTransformationTrait
conditional(Conditional $conditionalTransformation)
Specifies a conditional transformation whose condition should be met before applying a transformation.
VideoTransformationFlagTrait
noStream()
Don't stream a video that is currently being generated on the fly. Wait until the video is fully generated.
VideoTransformationFlagTrait
streamingAttachment(string $filename = null)
Causes the video download to begin immediately, streaming it as a fragmented video file.
VideoTransformationFlagTrait
hlsv3()
Deliver an HLS adaptive bitrate streaming file as HLS v3 instead of the default version (HLS v4).
VideoTransformationFlagTrait
keepDar()
Keep the Display Aspect Ratio metadata of the uploaded video.
VideoTransformationFlagTrait
mono()
Convert the audio channel to mono.
VideoTransformationFlagTrait
truncateTS()
Truncate (trim) a video file based on the start time defined in the metadata.
VideoTransformationFlagTrait
waveform()
Create a waveform image (in the format specified by the file extension) from the audio or video file.
VideoSpecificTransformationTrait
trim(Timeline $range)
Trims a video (and discards the rest).
VideoSpecificTransformationTrait
roundCorners(int|string $radius)
Rounds the corners of a video.
VideoSpecificTransformationTrait
overlay(BaseSource|string $videoLayer, BasePosition|null $position = null, Timeline|null $timeline = null)
Adds another video, text, image as an overlay over the container video.
VideoSpecificTransformationTrait
concatenate(VideoSource|string $videoSource)
Concatenates another video or image.
VideoSpecificTransformationTrait
cutter(VideoSource|string $videoLayer, BasePosition|null $position = null, Timeline|null $timeline = null)
Applies the video as a cutter for the main video.
VideoSpecificTransformationTrait
addSubtitles(string $subtitlesId)
Adds subtitles to the video.
VideoSpecificTransformationTrait
transcode(AudioCodec|VideoCodec|AudioFrequency|mixed $transcode)
Transcodes the video (or audio) to another format / adjusts encoding properties.
VideoSpecificTransformationTrait
fps(float|int|string $min, float|int|string|null $max = null)
Controls the range of acceptable FPS (Frames Per Second) to ensure that video (even when optimized) is delivered with an expected fps level (helps with sync to audio).
VideoSpecificTransformationTrait
keyframeInterval(float $interval)
Explicitly sets the keyframe interval of the delivered video.
VideoSpecificTransformationTrait
bitRate(int|string $bitRate, string $type = null)
Controls the video bitrate.
VideoSpecificTransformationTrait
streamingProfile(string $streamingProfile)
Sets the streaming profile to apply to an HLS or MPEG-DASH adaptive bitrate streaming video.
The value can be one of the pre-defined streaming profiles or a custom-defined one. You can use the streaming profiles methods of StreamingProfilesTrait to get a list of the available streaming profiles or to create new custom profiles.
VideoSpecificTransformationTrait
videoSampling(int|string $value)
Sets the total number of frames to sample from the original video.
Relevant when converting videos to animated GIF or WebP format. If not specified, the resulting GIF or WebP samples the whole video (up to 400 frames, at up to 10 frames per second). By default the duration of the animated image is the same as the duration of the video, no matter how many frames are sampled from the original video (use the delay qualifier to adjust the amount of time between frames).
VideoSpecificTransformationTrait
videoEdit(mixed $videoEdit)
Applies the specified video edit action.
static VideoSourceTrait|VideoSource
video(string $videoId = null)
Adds another video layer.
static VideoSourceTrait|FetchVideoSource
fetchVideo(string|null $fetchUrl)
Adds another video layer from a remote URL.
static VideoSourceTrait|SubtitlesSource
subtitles(string $subtitlesId = null)
Adds subtitles to a video.
static AudioSourceTrait|AudioSource
audio(string $audioId = null)
Adds another audio layer.
static ImageSourceTrait|ImageSource
image(string $publicId)
Adds another image layer.
static ImageSourceTrait|FetchImageSource
fetch(string|null $fetchUrl)
Adds another image layer.
static ImageSourceTrait|LutLayer
lut(string $lutId)
Applies a look-up table (LUT) file to the image.
static ImageSourceTrait|TextSource
text(string $text = null, string $style = null, string $color = null)
Adds a text layer.
__construct($source)
VideoLayer constructor.
$this
setSource(string|FetchSourceQualifier $source)
Sets the source of the layer.