force keyframe ignored (v4l2h264enc)

Nicolas Dufresne nicolas at ndufresne.ca
Tue Jun 1 15:00:25 UTC 2021


Le lundi 31 mai 2021 à 17:12 -0500, MichaelK via gstreamer-devel a écrit :
> 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.

Looks like it, I knew not much was missing, but failed to look at it. Mind make
a merge request ? (fork in gitlab into your namespace, then create branch,
commit your work, push it there and the push script will give you a link to
create the MR).

Let me know if you need further guidance.

> 
> Cheers.
> 
> Michael
> 
> 
> 
> 
> 
> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




More information about the gstreamer-devel mailing list