草庐IT

VTCompressionSession

全部标签

ios - 将来自 VTCompressionSession 的压缩帧与音频数据混合到 MPEG2-TS 容器中以进行网络流式传输

我正在从事一个项目,该项目涉及从iOS8中的VTCompressionSession抓取H.264编码帧,将它们与来自麦克风的实时AAC或PCM音频混合到可播放的MPEG2-TS中,并通过套接字实时流式传输最小延迟(即:(几乎)没有缓冲)。在观看了iOS8中新的VideoToolbox的演示并做了一些研究之后,我想可以安全地假设:您从VTCompressionSession获得的编码帧不是AnnexB格式,所以我需要以某种方式转换它们(到目前为止我看到的所有解释都太模糊,所以我不太确定你如何做到这一点(即:用长度header替换“3或4字节header”)。您从VTCompressio

objective-c - 如何在 swift 中创建 VTCompressionSession?

我一直在上下寻找如何创建VTCompressionSession(在swift)在2014WWDCVideo-'DirectAccesstoVideoEncodingandDecoding'中提到.以下代码适用于Objective-C:#import#importintmain(intargc,constchar*argv[]){@autoreleasepool{VTCompressionSessionRefsession;VTCompressionSessionCreate(NULL,500,500,kCMVideoCodecType_H264,NULL,NULL,NULL,NULL

swift - VTCompressionSession 跳过第一帧

我使用以下代码在Swift3中使用VTCompressionSession进行编码:letpixelBuffer=CMSampleBufferGetImageBuffer(sampleBuffer);letstatusCode=VTCompressionSessionEncodeFrame(compressionSession!,pixelBuffer!,CMSampleBufferGetPresentationTimeStamp(sampleBuffer),CMSampleBufferGetDuration(sampleBuffer)/*CMTimeMake(counter,1000

ios - 使用 VTCompressionSession 压缩的视频捕获播放速度太快

我正在从AVCaptureVideoDataOutput接收原始RGBA数据,并使用VTCompressionSession将其压缩为原始H264流。我遇到的问题是生成的流播放速度太快(在VLC中播放),大约是实际速度的3倍。我正在使用捕获数据中的呈现时间和持续时间。使用AVFileMovieOutput可以正常工作,但我想更好地控制压缩。我已经尝试设置kVTCompressionPropertyKey_ExpectedFrameRate但这没有区别。-(void)captureOutput:(AVCaptureOutput*)captureOutputdidOutputSampleB