Skip to content

Instantly share code, notes, and snippets.

@vakhidbetrakhmadov
vakhidbetrakhmadov / AVAsset+util.swift
Last active March 20, 2023 19:06
Cropping video track to a specified crop rectangle.
import Foundation
import AVFoundation
extension AVAsset {
func cropVideoTrack(at index: Int, cropRect: CGRect, outputURL: URL, completion: @escaping (Result<Void, Swift.Error>) -> Void) {
enum Orientation {
case up, down, right, left