Install ffmpeg
brew install ffmpeg
Download file through url, like this:
ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
//Protocal that copyable class should conform | |
protocol Copying { | |
init(original: Self) | |
} | |
//Concrete class extension | |
extension Copying { | |
func copy() -> Self { | |
return Self.init(original: self) | |
} |
#!/usr/bin/env xcrun swift | |
// $ chmod +x dalekTalk.swift | |
// $ ./dalekTalk.swift | |
// Based upon https://gist.github.com/okket/e461e85ea8b414863648 | |
import Cocoa | |
import AVFoundation | |
import Foundation |
#!/bin/bash | |
killall Xcode | |
xcrun -k | |
xcodebuild -alltargets clean | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
open /Applications/Xcode.app |
const fs = require('fs') | |
const crc32 = require('crc').crc32 | |
function findChunk(buffer, type) { | |
let offset = 8 | |
while (offset < buffer.length) { | |
let chunkLength = buffer.readUInt32BE(offset) | |
let chunkType = buffer.slice(offset + 4, offset + 8).toString('ascii') |
extension AVCaptureDevice { | |
/// http://stackoverflow.com/questions/21612191/set-a-custom-avframeraterange-for-an-avcapturesession#27566730 | |
func configureDesiredFrameRate(_ desiredFrameRate: Int) { | |
var isFPSSupported = false | |
do { | |
if let videoSupportedFrameRateRanges = activeFormat.videoSupportedFrameRateRanges as? [AVFrameRateRange] { |
// GitHub Reference: https://github.com/lixing123/ExtAudioFileConverter | |
// LAME iOS Build: https://github.com/kewlbear/lame-ios-build | |
#import <Foundation/Foundation.h> | |
#import <AudioToolbox/AudioToolbox.h> | |
NS_ASSUME_NONNULL_BEGIN | |
enum BitDepth{ |
/// RepeatingTimer mimics the API of DispatchSourceTimer but in a way that prevents | |
/// crashes that occur from calling resume multiple times on a timer that is | |
/// already resumed (noted by https://github.com/SiftScience/sift-ios/issues/52 | |
class RepeatingTimer { | |
let timeInterval: TimeInterval | |
init(timeInterval: TimeInterval) { | |
self.timeInterval = timeInterval | |
} |
public enum Direction { | |
case forward | |
case backward | |
} | |
internal var player: AVPlayer? | |
private var isSeekInProgress = false | |
private var chaseTime = kCMTimeZero | |
private var preferredFrameRate: Float = 23.98 |
Install ffmpeg
brew install ffmpeg
Download file through url, like this:
ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
class Synthesizer { | |
// MARK: - Variables | |
var audioEngine: AVAudioEngine! | |
var sourceNode: AVAudioSourceNode! | |
var time = Float.zero | |
var frequencyRamp = Float.zero | |
var currentFrequency: Float = 20 { | |
didSet { |