Explore low-latency video encoding with VideoToolbox

RSS for tag

Discuss the WWDC21 session Explore low-latency video encoding with VideoToolbox.

Posts under wwdc21-10158 tag

3 Posts

Post

Replies

Boosts

Views

Activity

About LTR support in VideoToolbox Encoding
Hi there, When I enable LTR by setting "kVTCompressionPropertyKey_EnableLTR" to be true, and get LTR refresh frame by setting ForceLTRRefresh to be true in VTCompressionSessionEncodeFrame() call. Everything goes well, but I found I cannot know which encoded frame is LTR Refresh frame, I try to find out, so dumpped the attachments of the CMSampleBuffer frame, I found the normal P frame's attachment like this: { DependsOnOthers = 1; EarlierDisplayTimesAllowed = 0; EncodedFrameAvgQP = 35; IsDependedOnByOthers = 1; NotSync = 1; RequireLTRAcknowledgementToken = 9177; TemporalID = 0; } And LTR refresh frame may look like this: { DependsOnOthers = 1; EarlierDisplayTimesAllowed = 0; EncodedFrameAvgQP = 38; FECGroupID = 0; FECLastFrameInGroup = 1; FECLevelOfProtection = 1; IsDependedOnByOthers = 1; NotSync = 1; ReferenceWasRefreshed = 1; RequireLTRAcknowledgementToken = 9180; TemporalID = 0; } The laster has 4 more key-value pairs than the former: FECGroupID = 0; FECLastFrameInGroup = 1; FECLevelOfProtection = 1; ReferenceWasRefreshed = 1; The key "ReferenceWasRefreshed" is very noticeable, So question 1: May this key signify current frame is a LTR Refresh frame? (But It's weird I didn't find any documents about this key.) Question 2: If this frame is LTR refresh frame, How can I know which frame this LTR frame refers to? More specifily, the corresponding 'AcknowledgementToken'. Question 3: This question is independent. I found that if I didn't set 'kVTEncodeFrameOptionKey_AcknowledgedLTRTokens' for a while (keep the tokens be empty), I cannot get the 'AcknowledgementToken' from encoded CMSampleBuffer for a while too, that's to say this key is not contained in the attachments of CMSampleBuffer. What should I do to make the encoded frame always contains the AcknowledgementToken? Thanks very much!
0
0
1.3k
Mar ’22
Could I set kVTVideoEncoderSpecification_EnableLowLatencyRateControl after ​​VTCompressionSessionCreate()
Hi, I am wondering whether I can set kVTVideoEncoderSpecification_EnableLowLatencyRateControl after VTCompressionSessionCreate()? I meant setting it by SetVTSessionProperty( compressionSession, kVTVideoEncoderSpecification_EnableLowLatencyRateControl, kCFBooleanTrue); And, compressionSession has been created by VTCompressionSessionCreate(). Is it necessary to set it before VTCompressionSessionCreate()?
0
0
681
Jul ’21
low-latency video encoding creation failed, error code 12902
VTCompressionSessionCreate returned 12902 if kVTVideoEncoderSpecification_EnableLowLatencyRateControl was picked. Code: CFMutableDictionaryRef encoderSpecification = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, NULL);         CFDictionarySetValue(encoderSpecification, kVTVideoEncoderSpecification_EnableLowLatencyRateControl, kCFBooleanTrue);     OSStatus result = VTCompressionSessionCreate(kCFAllocatorDefault, 640, 360, kCMVideoCodecType_H264, encoderSpecification, nullptr, nullptr, cb, outputCallbackRefCon, &m_session);     if(result != noErr){         return result;     }
3
0
1.2k
Jul ’21
About LTR support in VideoToolbox Encoding
Hi there, When I enable LTR by setting "kVTCompressionPropertyKey_EnableLTR" to be true, and get LTR refresh frame by setting ForceLTRRefresh to be true in VTCompressionSessionEncodeFrame() call. Everything goes well, but I found I cannot know which encoded frame is LTR Refresh frame, I try to find out, so dumpped the attachments of the CMSampleBuffer frame, I found the normal P frame's attachment like this: { DependsOnOthers = 1; EarlierDisplayTimesAllowed = 0; EncodedFrameAvgQP = 35; IsDependedOnByOthers = 1; NotSync = 1; RequireLTRAcknowledgementToken = 9177; TemporalID = 0; } And LTR refresh frame may look like this: { DependsOnOthers = 1; EarlierDisplayTimesAllowed = 0; EncodedFrameAvgQP = 38; FECGroupID = 0; FECLastFrameInGroup = 1; FECLevelOfProtection = 1; IsDependedOnByOthers = 1; NotSync = 1; ReferenceWasRefreshed = 1; RequireLTRAcknowledgementToken = 9180; TemporalID = 0; } The laster has 4 more key-value pairs than the former: FECGroupID = 0; FECLastFrameInGroup = 1; FECLevelOfProtection = 1; ReferenceWasRefreshed = 1; The key "ReferenceWasRefreshed" is very noticeable, So question 1: May this key signify current frame is a LTR Refresh frame? (But It's weird I didn't find any documents about this key.) Question 2: If this frame is LTR refresh frame, How can I know which frame this LTR frame refers to? More specifily, the corresponding 'AcknowledgementToken'. Question 3: This question is independent. I found that if I didn't set 'kVTEncodeFrameOptionKey_AcknowledgedLTRTokens' for a while (keep the tokens be empty), I cannot get the 'AcknowledgementToken' from encoded CMSampleBuffer for a while too, that's to say this key is not contained in the attachments of CMSampleBuffer. What should I do to make the encoded frame always contains the AcknowledgementToken? Thanks very much!
Replies
0
Boosts
0
Views
1.3k
Activity
Mar ’22
Could I set kVTVideoEncoderSpecification_EnableLowLatencyRateControl after ​​VTCompressionSessionCreate()
Hi, I am wondering whether I can set kVTVideoEncoderSpecification_EnableLowLatencyRateControl after VTCompressionSessionCreate()? I meant setting it by SetVTSessionProperty( compressionSession, kVTVideoEncoderSpecification_EnableLowLatencyRateControl, kCFBooleanTrue); And, compressionSession has been created by VTCompressionSessionCreate(). Is it necessary to set it before VTCompressionSessionCreate()?
Replies
0
Boosts
0
Views
681
Activity
Jul ’21
low-latency video encoding creation failed, error code 12902
VTCompressionSessionCreate returned 12902 if kVTVideoEncoderSpecification_EnableLowLatencyRateControl was picked. Code: CFMutableDictionaryRef encoderSpecification = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, NULL);         CFDictionarySetValue(encoderSpecification, kVTVideoEncoderSpecification_EnableLowLatencyRateControl, kCFBooleanTrue);     OSStatus result = VTCompressionSessionCreate(kCFAllocatorDefault, 640, 360, kCMVideoCodecType_H264, encoderSpecification, nullptr, nullptr, cb, outputCallbackRefCon, &m_session);     if(result != noErr){         return result;     }
Replies
3
Boosts
0
Views
1.2k
Activity
Jul ’21