Install the two dependencies, ImageMagick and Ghostscript.
$ brew install imagemagick
$ brew install ghostscript
//setting up the first video based on previous recording | |
CMTimeRange videoDuration = CMTimeRangeMake(kCMTimeZero, [self.previousRecording duration]); | |
AVAssetTrack *clipVideoTrack = [[self.previousRecording tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; | |
AVAssetTrack *clipAudioTrack = [[self.previousRecording tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0]; | |
[compositionVideoTrack insertTimeRange:videoDuration ofTrack:clipVideoTrack atTime:nextClipStartTime error:nil]; | |
[compositionAudioTrack insertTimeRange:videoDuration ofTrack:clipAudioTrack atTime:nextClipStartTime error:nil]; | |
//our first track instruction - set up the instruction layer, then check the orientation of the track | |
//if the track is in landscape-left mode, it needs to be rotated 180 degrees (PI) | |
AVMutableVideoCompositionLayerInstruction *firstTrackInstruction = |
-(UIImage*)mmg_imageScaledToFitSize:(CGSize)fitSize | |
{ | |
// Create a vImage_Buffer from the CGImage | |
CGImageRef sourceRef = self.CGImage; | |
vImage_Buffer srcBuffer; | |
vImage_CGImageFormat format = { | |
.bitsPerComponent = 8, | |
.bitsPerPixel = 32, | |
.colorSpace = NULL, | |
.bitmapInfo = (CGBitmapInfo)kCGImageAlphaFirst, |
#!/bin/bash | |
# git pre-commit hook that runs an clang-format stylecheck. | |
# Features: | |
# - abort commit when commit does not comply with the style guidelines | |
# - create a patch of the proposed style changes | |
# modifications for clang-format by [email protected] | |
# This file is part of a set of unofficial pre-commit hooks available | |
# at github. |
/// Observes a run loop to detect any stalling or blocking that occurs. | |
/// | |
/// This class is thread-safe. | |
@interface GHRunLoopWatchdog : NSObject | |
/// Initializes the receiver to watch the specified run loop, using a default | |
/// stalling threshold. | |
- (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
/// Initializes the receiver to detect when the specified run loop blocks for |
- (UIImage *)boxblurImage:(UIImage *)image boxSize:(int)boxSize | |
{ | |
CGImageRef originalImageRef = image.CGImage; | |
CGColorSpaceRef originalColorSpace = CGColorSpaceRetain(CGImageGetColorSpace(originalImageRef)); | |
if (_pixelBuffer == NULL) { | |
_pixelBuffer = malloc(CGImageGetBytesPerRow(originalImageRef) * CGImageGetHeight(originalImageRef)); | |
} | |
vImage_CGImageFormat inputImageFormat = |
// Created by Tony Mann on 3/22/15. | |
// Copyright (c) 2015 7Actions. All rights reserved. | |
// | |
// Adapted from http://ossh.com.au/design-and-technology/software-development/implementing-rich-text-with-images-on-os-x-and-ios/ | |
import UIKit | |
class ImageAttachment: NSTextAttachment { | |
var verticalOffset: CGFloat = 0.0 | |
# use pkg-config for getting CFLAGS and LDLIBS | |
FFMPEG_LIBS= libavdevice \ | |
libavformat \ | |
libavfilter \ | |
libavcodec \ | |
libswresample \ | |
libswscale \ | |
libavutil \ | |
CFLAGS += -Wall -g |