cannot pull stream when using Hardware Encoder


New Member
First question:

My setting is set to use 'Apple VT H264 Hardware Encoder', ‘KeyframeIntervalSec = 0’, according to instructions '0' means auto
When I use OBS to publish stream to NGINX, but i found only the first frame is the key frame, video gop is infinite, so i can't pull stream from NGINX because there's no key frame can send.
When I use OBS to record stream, there are key frame every few seconds, everything is fine.

I found in file 'plugins/mac-vth264/encoder.c', when 'enc->keyint = 0', 'kVTCompressionPropertyKey_MaxKeyFrameInterval' is set to '0.00', so 'Apple VideoTool' will not encode key frame after first key frame.
In 'Apple VideoTool', it says about 'kVTCompressionPropertyKey_MaxKeyFrameInterval', "Zero by default, which means no limit. This property is particularly useful when the frame rate is variable.".

But I think it's useless to set 'kVTCompressionPropertyKey_MaxKeyFrameInterval = 0' when we set 'enc->keyint = 0' in OBS, because we need to get the key frames from the live stream before we can start playing.

Second question:

When I use 'Apple VT H264 Hardware Encoder', ‘KeyframeIntervalSec = 0’, the h264 stream's SEI seems is wrong value, maybe I was wrong, it seems doesn't have any userdata in SEI, only has uuid in SEI, and there are five extra bytes after the end byte of 0x80, so ffmpeg parse error.

I will put the h264 stream, ffmpeg parse log and the setting picture on Attach files.


    484.4 KB · Views: 10