Skip to content

Instantly share code, notes, and snippets.

View ahmedAlmasri's full-sized avatar

Ahmad Almasri ahmedAlmasri

View GitHub Profile
@ahmedAlmasri
ahmedAlmasri / gist:b4380104362d66d619b6e9a06e947037
Created July 18, 2021 16:03 — forked from rgcottrell/gist:325ac087585ff6eeb8cb50e2729fd1ab
Transcode a movie to a different framerate.
// This sketches a script that will sample images from an AVAsset at a
// new framerate. This might be used to transcode a movie or create an
// animated GIF.
import AppKit
import AVFoundation
import CoreMedia
let FPS = 12 // The target framerate for the new movie.
let frameDuration = CMTimeMake(1, Int32(FPS))