iOS H264 decode&encode by VideoToolbox
pod 'iOSH264Compression'
1.Create VTCompressionH264Encode
let vTCompressionH264:VTCompressionH264Encode = VTCompressionH264Encode()
2.Set Options
vTCompressionH264.width = 480
vTCompressionH264.height = 640
vTCompressionH264.fps = 10
3.Set Encode Delegate
vTCompressionH264.delegate = self
4.PrepareTo Encode
vTCompressionH264.prepareToEncodeFrames()
4.Add BufferRef
vTCompressionH264.encode(by: sampleBuffer)
5.Invalidate
vTCompressionH264.invalidate()
1.Create VTCompressionH264Decode
let vTCompressionH264Decode:VTCompressionH264Decode = VTCompressionH264Decode()
2.Set Decode Delegate
vTCompressionH264Decode.delegate = self
3.Decode H264 Buffer
vTCompressionH264Decode.decode(byteHeaderData)
iOSH264 is released under the MIT license. See LICENSE for details.