A set of extensions and utilities to work with CoreVideo types.

Overview

core-video-tools

A set of extensions and utilities to work with CoreVideo types.

CVPixelFormat

While debuging Core Video objects, you need to understand what pixel format is used in them. To do this using vanilla API you are forced to find a mathing OSType value, because OSType if basically a number. This project uses CVPixelFormat enum istead of vanilla OSType public vars which is much more handy, and you can easyly get a description of a current pixel format.

let cvPixelFormat: CVPixelFormat = cvPixelBuffer.cvPixelFormat
let description = cvPixelFormat.description

Swifty API

There are a lot Swift wrappers over vanilla CVPixelBuffer C-style API:

Vanilla API:

let width = CVPixelBufferGetWidth(cvPixelBuffer)
let height = CVPixelBufferGetHeight(cvPixelBuffer)

// ...

let bytesPerElement = IOSurfaceGetBytesPerRow(ioSurface)
let bytesPerRow = IOSurfaceGetBytesPerRow(ioSurface)

Swifty API:

let width = cvPixelBuffer.width
let height = cvPixelBuffer.height

// ...

let bytesPerElement = ioSurface.bytesPerElement
let bytesPerRow = ioSurface.bytesPerRow

CVReturn Result & CVError

There are some functions in Core Video that return a code which helps if the operation succeeded. This project aims to simplify this error checking. CVReturn Result and CVError types are used to wrap vanilla API with thowable functions.

Vanilla API:

let returnCode = CVPixelBufferLockBaseAddress(cvPixelBuffer, lockFlags)
guard returnCode == kCVReturnSuccess else { // handle the error ...

Swifty API:

try cvPixelBuffer.lockBaseAddress(lockFlags: lockFlags)
You might also like...
The best way to watch Put.io on iPhone and iPad

The best way to watch Put.io on iPhone and iPad

📽 A video player for SwiftUI, support for caching, preload and custom control view.
📽 A video player for SwiftUI, support for caching, preload and custom control view.

Features QuickStart Advances Installation Requirements License Demo Clone or download the project. In the terminal, run swift package resolve. Open Vi

Swift Package used for video where I demonstrate how to extract a package to a local framework and modify it.
Swift Package used for video where I demonstrate how to extract a package to a local framework and modify it.

SegmentedPicker NOTE: This sample code is taken from the article by Frank Jia in his article titled Build a Custom iOS Segmented Control With SwiftUI

iOS video player for trailer. You can customize layout for the control panel. Support PiP and DRM.

iOS video player for trailer. You can customize layout for the control panel. Support PiP and DRM.

A simple iOS app similar to iTunes where you can view details of your favorite movies, songs and audio books.
A simple iOS app similar to iTunes where you can view details of your favorite movies, songs and audio books.

Popcorn Adventure This is an iOS app developed by Arthur Tristan M. Ramos who has taken the Appetiser iOS Coding Challenge. Design Pattern The design

VIMVideoPlayer is a simple wrapper around the AVPlayer and AVPlayerLayer classes.

VIMVideoPlayer is a simple wrapper around the AVPlayer and AVPlayerLayer classes.

A powerful and completely customizable media player for iOS
A powerful and completely customizable media player for iOS

MobilePlayer A powerful and completely customizable media player for iOS. Table of Contents Features Installation Usage Customization Skinning Showing

YouTube video player for iOS, tvOS and macOS
YouTube video player for iOS, tvOS and macOS

About XCDYouTubeKit is a YouTube video player for iOS, tvOS and macOS. Are you enjoying XCDYouTubeKit? You can say thank you with a tweet. I am also a

A Photo and Video Gallery
A Photo and Video Gallery

================== bitcoin:1Lj45X69tPYAPqnZP2c9Ccs349fC2CEMQo Podfile platform :ios, '7.0' pod 'MHVideoPhotoGallery' Supported Videos Youtube Vimeo We

Releases(0.0.6)
Owner
eugene
eugene
High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.

High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.

BearRuan 650 Dec 30, 2022
MMPlayerView - Custom AVPlayerLayer on view and transition player with good effect like youtube and facebook

MMPlayerView Demo-Swift List / Shrink / Transition / Landscape MMPlayerLayer ex. use when change player view frequently like tableView / collectionVie

Millman Yang 724 Nov 24, 2022
Yattee: video player for Invidious and Piped built for iOS 15, tvOS 15 and macOS Monterey

Video player with support for Invidious and Piped instances built for iOS 15, tvOS 15 and macOS Monterey.

Yattee 1k Dec 27, 2022
Yattee: video player for Invidious and Piped built for iOS, tvOS and macOS

Video player for Invidious and Piped instances built for iOS, tvOS and macOS. Features Native user interface built with SwiftUI Multiple instances and

Yattee 1.1k Jan 8, 2023
Camera and Microphone streaming library via RTMP, HLS for iOS, macOS, tvOS.

HaishinKit (formerly lf) Camera and Microphone streaming library via RTMP, HLS for iOS, macOS, tvOS. Issuesの言語は、日本語が分かる方は日本語でお願いします! Sponsored with ??

shogo4405 2.4k Dec 29, 2022
A video composition framework build on top of AVFoundation. It's simple to use and easy to extend.

A high-level video composition framework build on top of AVFoundation. It's simple to use and easy to extend. Use it and make life easier if you are implementing video composition feature.

VideoFlint 1.4k Dec 25, 2022
MobilePlayer - A powerful and completely customizable media player for iOS

MobilePlayer A powerful and completely customizable media player for iOS. Table of Contents Features Installation Usage Customization Skinning Showing

Sahin Boydas 3k Jan 2, 2023
NextLevelSessionExporter is an export and transcode media library for iOS written in Swift.

NextLevelSessionExporter ?? NextLevelSessionExporter is an export and transcode media library for iOS written in Swift. The library provides customiza

NextLevel 233 Nov 27, 2022
▶️ video player in Swift, simple way to play and stream media on iOS/tvOS

Player Player is a simple iOS video player library written in Swift. Looking for an obj-c video player? Check out PBJVideoPlayer (obj-c). Looking for

patrick piemonte 2k Jan 2, 2023
Repository with base samples for playing HLS/DASH with CMAF video, across as many platforms as possible. Includes steps for encoding and packaging your own test content.

Video Everything Repository with minimal samples for playing HLS/DASH with CMAF video, across as many platforms as possible. Content and License All t

Alex Dodge 3 Jul 4, 2021