Class
AVTransform
public class AVTransform: Transform
Converts a video or audio to a different format, resolution, sample rate, etc.
Relationships
Superclass
Transform
:nodoc:
Initializers
Methods
preset(_:)
@discardableResult
func preset(_ value: String) -> Self
Adds the preset
option.
Parameters
Name | Type | Description |
---|---|---|
value | String |
The format to convert to. See (File Processing - Video Conversion)[https://www.filestack.com/docs/video-transformations] for more information about supported presets. |
force(_:)
@discardableResult
func force(_ value: Bool) -> Self
Adds the force
option.
Parameters
Name | Type | Description |
---|---|---|
value | Bool |
Restarts completed or pending video encoding. If a transcoding fails, and you make the same request again, it will not restart the transcoding process unless this parameter is set to |
width(_:)
@discardableResult
func width(_ value: Int) -> Self
Adds the width
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
Set the width in pixels of the video that is generated by the transcoding process. |
height(_:)
@discardableResult
func height(_ value: Int) -> Self
Adds the height
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
Set the height in pixels of the video that is generated by the transcoding process. |
title(_:)
@discardableResult
func title(_ value: String) -> Self
Adds the title
option.
Parameters
Name | Type | Description |
---|---|---|
value | String |
Set the title in the file metadata. |
extName(_:)
@discardableResult
func extName(_ value: String) -> Self
Adds the extName
option.
Parameters
Name | Type | Description |
---|---|---|
value | String |
Set the file extension for the video that is generated by the transcoding process. |
fileName(_:)
@discardableResult
func fileName(_ value: String) -> Self
Adds the fileName
option.
Parameters
Name | Type | Description |
---|---|---|
value | String |
Set the filename of the video that is generated by the transcoding process. |
location(_:)
@discardableResult
func location(_ value: StorageLocation) -> Self
Adds the location
option.
Parameters
Name | Type | Description |
---|---|---|
value | StorageLocation |
An |
path(_:)
@discardableResult
func path(_ value: String) -> Self
Adds the path
option.
Parameters
Name | Type | Description |
---|---|---|
value | String |
The path to store the file at within the specified file store. For S3, this is the key where the file will be stored at. By default, Filestack stores the file at the root at a unique id, followed by an underscore, followed by the filename, for example: |
access(_:)
@discardableResult
func access(_ value: StorageAccess) -> Self
Adds the access
option.
Parameters
Name | Type | Description |
---|---|---|
value | StorageAccess |
An |
container(_:)
@discardableResult
func container(_ value: String) -> Self
Adds the container
option.
Parameters
Name | Type | Description |
---|---|---|
value | String |
The bucket or container in the specified file store where the file should end up. |
upscale(_:)
@discardableResult
func upscale(_ value: Bool) -> Self
Adds the upscale
option.
Parameters
Name | Type | Description |
---|---|---|
value | Bool |
Upscale the video resolution to match your profile. Defaults to |
aspectMode(_:)
@discardableResult
func aspectMode(_ value: TransformAspectMode) -> Self
Adds the aspectMode
option.
Parameters
Name | Type | Description |
---|---|---|
value | TransformAspectMode |
An |
twoPass(_:)
@discardableResult
func twoPass(_ value: Bool) -> Self
Adds the twoPass
option.
Parameters
Name | Type | Description |
---|---|---|
value | Bool |
Specify that the transcoding process should do two passes to improve video quality. Defaults to |
videoBitRate(_:)
@discardableResult
func videoBitRate(_ value: Int) -> Self
Adds the videoBitRate
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
Specify the video bitrate for the video that is generated by the transcoding process. Valid range: |
fps(_:)
@discardableResult
func fps(_ value: Int) -> Self
Adds the fps
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
Specify the frames per second of the video that is generated by the transcoding process. Valid range: |
keyframeInterval(_:)
@discardableResult
func keyframeInterval(_ value: Int) -> Self
Adds the keyframeInterval
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
Adds a key frame every |
audioBitRate(_:)
@discardableResult
func audioBitRate(_ value: Int) -> Self
Adds the audioBitRate
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
Sets the audio bitrate for the video that is generated by the transcoding process. Valid range: |
audioSampleRate(_:)
@discardableResult
func audioSampleRate(_ value: Int) -> Self
Adds the audioSampleRate
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
Set the audio sample rate for the video that is generated by the transcoding process. Valid range: |
audioChannels(_:)
@discardableResult
func audioChannels(_ value: Int) -> Self
Adds the audioChannels
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
Set the number of audio channels for the video that is generated by the transcoding process. Valid range: |
clipLength(_:)
@discardableResult
func clipLength(_ value: String) -> Self
Adds the clipLength
option.
Parameters
Name | Type | Description |
---|---|---|
value | String |
Set the length of the video that is generated by the transcoding process. Valid format should include hours, minutes and seconds. |
clipOffset(_:)
@discardableResult
func clipOffset(_ value: String) -> Self
Adds the clipOffset
option.
Parameters
Name | Type | Description |
---|---|---|
value | String |
Set the point to begin the video clip from. For example, |
watermarkURL(_:)
@discardableResult
func watermarkURL(_ value: URL) -> Self
Adds the watermarkURL
option.
Parameters
Name | Type | Description |
---|---|---|
value | URL |
The Filestack handle or URL of the image file to use as a watermark on the transcoded video. |
watermarkTop(_:)
@discardableResult
func watermarkTop(_ value: Int) -> Self
Adds the watermarkTop
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
The distance from the top of the video frame to place the watermark on the video. Valid range: |
watermarkBottom(_:)
@discardableResult
func watermarkBottom(_ value: Int) -> Self
Adds the watermarkBottom
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
The distance from the bottom of the video frame to place the watermark on the video. Valid range: |
watermarkLeft(_:)
@discardableResult
func watermarkLeft(_ value: Int) -> Self
Adds the watermarkLeft
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
The distance from the left of the video frame to place the watermark on the video. Valid range: |
watermarkRight(_:)
@discardableResult
func watermarkRight(_ value: Int) -> Self
Adds the watermarkRight
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
The distance from the right of the video frame to place the watermark on the video. Valid range: |
watermarkWidth(_:)
@discardableResult
func watermarkWidth(_ value: Int) -> Self
Adds the watermarkWidth
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
Resize the width of the watermark. |
watermarkHeight(_:)
@discardableResult
func watermarkHeight(_ value: Int) -> Self
Adds the watermarkHeight
option.
Parameters
Name | Type | Description |
---|---|---|
value | Int |
Resize the height of the watermark. |