我使用VTCompressionSessionEncodeFrame来编码()iPhone相机中的CMSampleBufferRef,并在回调中获取CMSampleBufferRef,并记录:
CMSampleBuffer 0x124652e40 retainCount: 1 allocator: 0x1a1240b68
invalid = NO
dataReady = YES
makeDataReadyCallback = 0x0
makeDataReadyRefcon = 0x0
formatDescription = <CMVideoFormatDescription 0x124628310 [0x1a1240b68]> {
mediaType:'vide'
mediaSubType:'avc1'
mediaSpecific: {
codecType: 'avc1' dimensions: 480 x 360
}
extensions: {<CFBasicHash 0x124652c10 [0x1a1240b68]>{type = immutable dict, count = 2,
entries =>
0 : <CFString 0x19cc923e0 [0x1a1240b68]>{contents = "SampleDescriptionExtensionAtoms"} = <CFBasicHash 0x124647750 [0x1a1240b68]>{type = immutable dict, count = 1,
entries =>
2 : <CFString 0x19cc97c20 [0x1a1240b68]>{contents = "avcC"} = <CFData 0x124653250 [0x1a1240b68]>{length = 30, capacity = 30, bytes = 0x0164001effe1000b2764001eac56c1e0 ... 28ee3cb0fdf8f800}
}
2 : <CFString 0x19cc92440 [0x1a1240b68]>{contents = "FormatName"} = H.264
}
}
}
sbufToTrackReadiness = 0x0
numSamples = 1
sampleTimingArray[1] = {
{PTS = {1455526984040951/1000000 = 1455526984.041}, DTS = {INVALID}, duration = {214486/1000000 = 0.214}},
}
sampleSizeArray[1] = {
sampleSize = 9199,
}
sampleAttachmentsArray[1] = {
sample 0:
DependsOnOthers = false
}
dataBuffer = 0x124652ff0
那么,如何将CMSampleBufferRef推送到rtmp服务器使用librtmp?谁有一个例子?想!