Skip to content

Instantly share code, notes, and snippets.

View depthlove's full-sized avatar

depthlove depthlove

View GitHub Profile
@caojianhua
caojianhua / OpenGLToCVPixelBuffer.m
Created January 27, 2016 09:29
Create CVPixelBufferRef from OpenGL
@interface SREAGLContext : NSObject
+ (EAGLContext*)sharedContext;
+ (EAGLContext*)newContext: (EAGLRenderingAPI) api;
@end
@implementation SREAGLContext
@waveacme
waveacme / DecodeActivity.java
Created January 15, 2016 08:30
MediaCodec decode h264 example
//from https://github.com/vecio/MediaCodecDemo
package io.vec.demo.mediacodec;
import java.nio.ByteBuffer;
import android.app.Activity;
import android.media.MediaCodec;
import android.media.MediaCodec.BufferInfo;
@zacwest
zacwest / ios-font-sizes.swift
Last active September 25, 2025 07:59
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@marteinn
marteinn / example-image.png
Last active January 20, 2021 04:08
NSAlert Example: How to show a NSAlert as a sheet in a NSView (Cocoa)
example-image.png

Live Transcoding

This is a collection of working commandline examples to show how one could use FFMpeg and VLC for live transcoding of video streams. All examples have been tested on OSX 10.7.5 with FFMPeg 1.1.3 and VLC 2.0.5 in early 2013.

Documentation links

@johnpaulmanoza
johnpaulmanoza / GPUImageFourInputFilter.h
Created April 13, 2015 06:06
GPUImage Add Four Input Filter
#import <GPUImageThreeInputFilter.h>
extern NSString *const kGPUImageFourInputTextureVertexShaderString;
@interface GPUImageFourInputFilter : GPUImageThreeInputFilter
{
GPUImageFramebuffer *fourthInputFramebuffer;
GLint filterFourthTextureCoordinateAttribute;
GLint filterInputTextureUniform4;
@melode11
melode11 / boost_ios_install.sh
Created April 8, 2015 08:11
boost_ios_install.sh modified from boost.sh
#===============================================================================
# Filename: boost.sh
# Author: Pete Goodliffe
# Copyright: (c) Copyright 2009 Pete Goodliffe
# Licence: Please feel free to use this, with attribution
# Modified version
#===============================================================================
#
# Builds a Boost framework for the iPhone.
# Creates a set of universal libraries that can be used on an iPhone and in the
@virasio
virasio / GPUImageMirrorFilter.h
Created February 25, 2015 10:16
Mirror filter for GPUImage
//
// GPUImageMirrorFilter.h
//
#import <GPUImage/GPUImageFilter.h>
@interface GPUImageMirrorFilter : GPUImageFilter {
GLint verticalMirrorUniform, horizontalMirrorUniform;
}
@rfistman
rfistman / PacketAudioBitRate.m
Last active March 29, 2018 07:15
Trying to get bitrate of mp3/aac packetized audio with AVFoundation/CoreMedia
// Was hoping to find at least bitrate in packet data, maybe in attachments
// via AVFoundation/CoreMedia. This data is in every mp3 and (I think) aac packet
// yet it seems to be discarded. Anyone know where I can find it without parsing
// by hand or inferring from file duration and size?
// sample rate and number of channels is available.
NSString *path = @"path to mp3/aac/whatevs";
AVAsset *asset = [[AVURLAsset alloc] initWithURL:[NSURL fileURLWithPath:path] options:nil];
[asset loadValuesAsynchronouslyForKeys:@[@"duration"] completionHandler:^{
@tomnomnom
tomnomnom / simple-json-api.go
Created December 20, 2014 16:34
Simple JSON API Server in Go
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
)
// The `json:"whatever"` bit is a way to tell the JSON