| #import <AVFoundation/AVFoundation.h> | |
| @interface AVCaptureDevice(Additions) | |
| + (NSArray<AVCaptureDevice *>*)inputCameraDevices; | |
| - (BOOL)isBuiltIn; | |
| - (BOOL)hasVideoMedia; | |
| - (BOOL)canOpenCamera; | |
| @end |
| -(CVPixelBufferRef)imageToYUVPixelBuffer:(UIImage *)image{ | |
| // convert to CGImage & dump to bitmapData | |
| CGImageRef imageRef = [image CGImage]; | |
| int width = (int)CGImageGetWidth(imageRef); | |
| int height = (int)CGImageGetHeight(imageRef); | |
| CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); | |
| NSUInteger bytesPerPixel = 4; | |
| NSUInteger bytesPerRow = ((bytesPerPixel*width+255)/256)*256; |
| // | |
| // headphones-detect.c | |
| // Kyle Neideck, [email protected] | |
| // | |
| // Compile with: | |
| // clang -framework CoreAudio -framework CoreFoundation -o headphones-detect headphones-detect.c | |
| // | |
| // Runs a command when headphones are plugged in to or unplugged from the | |
| // built-in audio device. | |
| // |
| // | |
| // ViewController.swift | |
| // MP3RecordingSample | |
| // | |
| // Created by Tadashi on 2017/10/13. | |
| // Copyright © 2017 UBUNIFU Inc. All rights reserved. | |
| // | |
| import UIKit | |
| import AVFoundation | |
| import AudioToolbox |
System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
###1. 推流端 直播技术的流程大致可以分为几个步骤:数据采集、数据处理、视频编码、封包发送、云端(服务端)(转码、录制、分发)、播放器。
- 数据采集:通过摄像头和麦克风获得实时的音视频数据;
- 数据处理:将数据采集的输入流进行实时滤镜,得到我们美化之后的音视频数据, 视频包括各种处理滤镜,美颜,动态贴纸等, 音频包括降噪, 放大等处理;
- 音视频编码:编码分为软编码和硬编码。现在直播默认的编码都是
H.264。软编码是利用CPU进行编码,硬编码就是使用GPU进行编码。软编码支持现在所有的系统版本。由于苹果在iOS8才开放硬编码的API,故硬编码只支持iOS8以上的系统; - 封包发送:现在直播推流中,一般采用的格式是
FLV, 然后利用ffmpeg或者librtmp进行传输, 这两者封包的处理是不一样的,我们采用的是ffmpeg, 所以没有对librtmp进行深入的研究; - 云端(服务端):进行流的转码、分发和录制;
- 播放器:负责拉流、解码、播放。
| # impor spark, set spark context | |
| from pyspark import SparkContext, SparkConf | |
| from pyspark.sql.context import SQLContext | |
| import sys | |
| import os | |
| if len(sys.argv) == 1: | |
| sys.stderr.write("Must enter input file to convert") | |
| sys.exit() | |
| input_file = sys.argv[1] |
| // | |
| // PLGPUImageFilterViewController.m | |
| // PLStreamingKit | |
| // | |
| // Created by 0dayZh on 16/3/8. | |
| // Copyright © 2016年 0dayZh. All rights reserved. | |
| // | |
| #import "PLGPUImageFilterViewController.h" | |
| #import "GPUImage.h" |
(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)
-
Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories
-
Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.
-
Save that list to some path
-
The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.