AVTransform

public class AVTransform : Transform

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

Lifecycle

  • Initializes an AVTransform object.

    Declaration

    Swift

    public init()

Public Functions

  • Adds the preset option.

    Declaration

    Swift

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

    Parameters

    value

    The format to convert to. See (File Processing - Video Conversion)[https://www.filestack.com/docs/video-transformations] for more information about supported presets.

  • Adds the force option.

    Declaration

    Swift

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

    Parameters

    value

    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.

  • Adds the width option.

    Declaration

    Swift

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

    Parameters

    value

    Set the width in pixels of the video that is generated by the transcoding process.

  • Adds the height option.

    Declaration

    Swift

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

    Parameters

    value

    Set the height in pixels of the video that is generated by the transcoding process.

  • Adds the title option.

    Declaration

    Swift

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

    Parameters

    value

    Set the title in the file metadata.

  • Adds the extName option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the fileName option.

    Declaration

    Swift

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

    Parameters

    value

    Set the filename of the video that is generated by the transcoding process.

  • Adds the location option.

    Declaration

    Swift

    @discardableResult
    func location(_ value: StorageLocation) -> Self

    Parameters

    value

    An StorageLocation value.

  • Adds the path option.

    Declaration

    Swift

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

    Parameters

    value

    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.

  • Adds the access option.

    Declaration

    Swift

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

    Parameters

    value

    An StorageAccess value.

  • Adds the container option.

    Declaration

    Swift

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

    Parameters

    value

    The bucket or container in the specified file store where the file should end up.

  • Adds the upscale option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the aspectMode option.

    Declaration

    Swift

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

    Parameters

    value
  • Adds the twoPass option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the videoBitRate option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the fps option.

    Declaration

    Swift

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

    Parameters

    value

    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.

  • Adds the keyframeInterval option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the audioBitRate option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the audioSampleRate option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the audioChannels option.

    Declaration

    Swift

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

    Parameters

    value

    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.

  • Adds the clipLength option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the clipOffset option.

    Declaration

    Swift

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

    Parameters

    value

    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.

  • Adds the watermarkURL option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the watermarkTop option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the watermarkBottom option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the watermarkLeft option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the watermarkRight option.

    Declaration

    Swift

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

    Parameters

    value

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

  • Adds the watermarkWidth option.

    Declaration

    Swift

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

    Parameters

    value

    Resize the width of the watermark.

  • Adds the watermarkHeight option.

    Declaration

    Swift

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

    Parameters

    value

    Resize the height of the watermark.