Filestack Documentation

Class AVTransform

public class AVTransform: Transform  

Converts a video or audio to a different format, resolution, sample rate, etc.

AVTransform AVTransform Transform Transform AVTransform->Transform

Superclass

Transform

:nodoc:

Initializers

init()

public init()  

Initializes an AVTransform object.

Methods

preset(_:​)

@discardableResult
    func preset(_ value: String) -> Self  

Adds the preset option.

Parameters

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

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 true.

width(_:​)

@discardableResult
    func width(_ value: Int) -> Self  

Adds the width option.

Parameters

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

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

value String

Set the title in the file metadata.

ext​Name(_:​)

@discardableResult
    func extName(_ value: String) -> Self  

Adds the extName option.

Parameters

value String

Set the file extension for the video that is generated by the transcoding process.

file​Name(_:​)

@discardableResult
    func fileName(_ value: String) -> Self  

Adds the fileName option.

Parameters

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

value Storage​Location

An StorageLocation value.

path(_:​)

@discardableResult
    func path(_ value: String) -> Self  

Adds the path option.

Parameters

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: 3AB239102DB_myvideo.mp4.

access(_:​)

@discardableResult
    func access(_ value: StorageAccess) -> Self  

Adds the access option.

Parameters

value Storage​Access

An StorageAccess value.

container(_:​)

@discardableResult
    func container(_ value: String) -> Self  

Adds the container option.

Parameters

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

value Bool

Upscale the video resolution to match your profile. Defaults to true.

aspect​Mode(_:​)

@discardableResult
    func aspectMode(_ value: TransformAspectMode) -> Self  

Adds the aspectMode option.

Parameters

value Transform​Aspect​Mode

An TransformAspectMode value.

two​Pass(_:​)

@discardableResult
    func twoPass(_ value: Bool) -> Self  

Adds the twoPass option.

Parameters

value Bool

Specify that the transcoding process should do two passes to improve video quality. Defaults to false.

video​Bit​Rate(_:​)

@discardableResult
    func videoBitRate(_ value: Int) -> Self  

Adds the videoBitRate option.

Parameters

value Int

Specify the video bitrate for the video that is generated by the transcoding process. Valid range: 1...5000

fps(_:​)

@discardableResult
    func fps(_ value: Int) -> Self  

Adds the fps option.

Parameters

value Int

Specify the frames per second of the video that is generated by the transcoding process. Valid range: 1...300. If ommited, uses the original fps of the source file.

keyframe​Interval(_:​)

@discardableResult
    func keyframeInterval(_ value: Int) -> Self  

Adds the keyframeInterval option.

Parameters

value Int

Adds a key frame every keyframeInterval frames to the video that is generated by the transcoding process. Default is 250.

audio​Bit​Rate(_:​)

@discardableResult
    func audioBitRate(_ value: Int) -> Self  

Adds the audioBitRate option.

Parameters

value Int

Sets the audio bitrate for the video that is generated by the transcoding process. Valid range: 0...999

audio​Sample​Rate(_:​)

@discardableResult
    func audioSampleRate(_ value: Int) -> Self  

Adds the audioSampleRate option.

Parameters

value Int

Set the audio sample rate for the video that is generated by the transcoding process. Valid range: 0...99999. Default is 44100.

audio​Channels(_:​)

@discardableResult
    func audioChannels(_ value: Int) -> Self  

Adds the audioChannels option.

Parameters

value Int

Set the number of audio channels for the video that is generated by the transcoding process. Valid range: 1...12. Default is same as source video.

clip​Length(_:​)

@discardableResult
    func clipLength(_ value: String) -> Self  

Adds the clipLength option.

Parameters

value String

Set the length of the video that is generated by the transcoding process. Valid format should include hours, minutes and seconds.

clip​Offset(_:​)

@discardableResult
    func clipOffset(_ value: String) -> Self  

Adds the clipOffset option.

Parameters

value String

Set the point to begin the video clip from. For example, 00:00:10 will start the video transcode 10 seconds into the source video. Valid format should include hours, minutes and seconds.

watermark​URL(_:​)

@discardableResult
    func watermarkURL(_ value: URL) -> Self  

Adds the watermarkURL option.

Parameters

value URL

The Filestack handle or URL of the image file to use as a watermark on the transcoded video.

watermark​Top(_:​)

@discardableResult
    func watermarkTop(_ value: Int) -> Self  

Adds the watermarkTop option.

Parameters

value Int

The distance from the top of the video frame to place the watermark on the video. Valid range: 0...9999

watermark​Bottom(_:​)

@discardableResult
    func watermarkBottom(_ value: Int) -> Self  

Adds the watermarkBottom option.

Parameters

value Int

The distance from the bottom of the video frame to place the watermark on the video. Valid range: 0...9999

watermark​Left(_:​)

@discardableResult
    func watermarkLeft(_ value: Int) -> Self  

Adds the watermarkLeft option.

Parameters

value Int

The distance from the left of the video frame to place the watermark on the video. Valid range: 0...9999

watermark​Right(_:​)

@discardableResult
    func watermarkRight(_ value: Int) -> Self  

Adds the watermarkRight option.

Parameters

value Int

The distance from the right of the video frame to place the watermark on the video. Valid range: 0...9999

watermark​Width(_:​)

@discardableResult
    func watermarkWidth(_ value: Int) -> Self  

Adds the watermarkWidth option.

Parameters

value Int

Resize the width of the watermark.

watermark​Height(_:​)

@discardableResult
    func watermarkHeight(_ value: Int) -> Self  

Adds the watermarkHeight option.

Parameters

value Int

Resize the height of the watermark.