force keyframe ignored (v4l2h264enc)

MichaelK michael.kerr at rmit.edu.au
Mon May 31 22:12:18 UTC 2021


Thanks Nicolas,

I can confirm this works.  I added the below definition to
gst_v4l2_video_enc_handle_frame()

+GstV4l2Object *v4l2object = self->v4l2output;

And the below if statement just before GST_VIDEO_ENCODER_STREAM_UNLOCK
(encoder);

+
+
+if (GST_VIDEO_CODEC_FRAME_IS_FORCE_KEYFRAME (frame)) {
+ struct v4l2_control ctrl = { V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME, 1 };
+  if (v4l2object->ioctl (v4l2object->video_fd,VIDIOC_S_CTRL , &ctrl) < 0)
+    GST_ELEMENT_WARNING (self, RESOURCE, FAILED,
+        (_("Failed to force keyframe.")), (NULL));
+}
+

My keyframe triggers are being picked up and actioned.

Thanks very much for the info, it was just what I needed.

Cheers.

Michael








--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list