{"id":13908611,"url":"https://github.com/MetalPetal/VideoIO","last_synced_at":"2025-07-18T07:31:46.756Z","repository":{"id":36635301,"uuid":"228981217","full_name":"MetalPetal/VideoIO","owner":"MetalPetal","description":"Video Input/Output Utilities","archived":false,"fork":false,"pushed_at":"2024-04-06T12:23:34.000Z","size":3620,"stargazers_count":173,"open_issues_count":7,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-25T09:25:35.822Z","etag":null,"topics":["audio","avfoundation","camera","ios","macos","player","video","video-processing"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MetalPetal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-19T05:24:47.000Z","updated_at":"2024-11-11T18:56:25.000Z","dependencies_parsed_at":"2024-04-16T03:43:33.216Z","dependency_job_id":"0cbded54-fe1a-410e-92c8-7986df368c67","html_url":"https://github.com/MetalPetal/VideoIO","commit_stats":{"total_commits":129,"total_committers":8,"mean_commits":16.125,"dds":"0.16279069767441856","last_synced_commit":"1623b3d597d8ae987979ce8ac7b1ce0d085d2855"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetalPetal%2FVideoIO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetalPetal%2FVideoIO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetalPetal%2FVideoIO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetalPetal%2FVideoIO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MetalPetal","download_url":"https://codeload.github.com/MetalPetal/VideoIO/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226372202,"owners_count":17614653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","avfoundation","camera","ios","macos","player","video","video-processing"],"created_at":"2024-08-06T23:02:51.826Z","updated_at":"2024-11-25T17:31:39.580Z","avatar_url":"https://github.com/MetalPetal.png","language":"Swift","readme":"# VideoIO\n\n![](https://github.com/MetalPetal/VideoIO/workflows/Swift/badge.svg)\n\nVideo Input/Output Utilities\n\n## VideoComposition\n\nWraps around `AVMutableVideoComposition` with custom video compositor. A `BlockBasedVideoCompositor` is provided for convenience.\n\nWith [MetalPetal](https://github.com/MetalPetal/MetalPetal)\n\n```Swift\nlet context = try! MTIContext(device: MTLCreateSystemDefaultDevice()!)\nlet handler = MTIAsyncVideoCompositionRequestHandler(context: context, tracks: asset.tracks(withMediaType: .video)) {   request in\n    return FilterGraph.makeImage { output in\n        request.anySourceImage =\u003e filterA =\u003e filterB =\u003e output\n    }!\n}\nlet composition = VideoComposition(propertiesOf: asset, compositionRequestHandler: handler.handle(request:))\nlet playerItem = AVPlayerItem(asset: asset)\nplayerItem.videoComposition = composition.makeAVVideoComposition()\nplayer.replaceCurrentItem(with: playerItem)\nplayer.play()\n```\n\nWithout MetalPetal\n\n```Swift\nlet composition = VideoComposition(propertiesOf: asset, compositionRequestHandler: { request in\n    //Process video frame\n})\nlet playerItem = AVPlayerItem(asset: asset)\nplayerItem.videoComposition = composition.makeAVVideoComposition()\nplayer.replaceCurrentItem(with: playerItem)\nplayer.play()\n```\n\n## AssetExportSession\n\nExport `AVAsset`s. With the ability to customize video/audio settings as well as `pause` / `resume`.\n\n```Swift\nvar configuration = AssetExportSession.Configuration(fileType: .mp4, videoSettings: .h264(videoSize: videoComposition.renderSize), audioSettings: .aac(channels: 2, sampleRate: 44100, bitRate: 128 * 1000))\nconfiguration.metadata = ...\nconfiguration.videoComposition = ...\nconfiguration.audioMix = ...\nself.exporter = try! AssetExportSession(asset: asset, outputURL: outputURL, configuration: configuration)\nexporter.export(progress: { p in\n    \n}, completion: { error in\n    //Done\n})\n```\n\n## PlayerVideoOutput\n\nOutput video buffers from `AVPlayer`.\n\n```Swift\nlet player: AVPlayer = ...\nlet playerOutput = PlayerVideoOutput(player: player) { videoFrame in\n    //Got video frame\n}\nplayer.play()\n```\n\n## MovieRecorder\n\nRecord video and audio.\n\n## AudioQueueCaptureSession\n\nCapture audio using `AudioQueue`.\n\n## Camera\n\nSimple audio/video capture.\n\n","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMetalPetal%2FVideoIO","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMetalPetal%2FVideoIO","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMetalPetal%2FVideoIO/lists"}