Can't decode frames for H264 stream encoded using NVENC over RTP

Gary Metalle Gary.Metalle at rvl.co.uk
Thu Oct 22 07:31:13 UTC 2020


Hi

I use the following code snippet to force a key frame on-demand (should work on any encoder):

	if (update) {
	        GstPad *encoder_src_pad = NULL;
                encoder_src_pad = gst_element_get_static_pad(st->streamer.encoder, "src");
		if (encoder_src_pad) {
			gst_pad_send_event(encoder_src_pad, gst_event_new_custom(GST_EVENT_CUSTOM_UPSTREAM,
				gst_structure_new("GstForceKeyUnit", "all-headers",G_TYPE_BOOLEAN, TRUE, NULL)));
			gst_object_unref(encoder_src_pad);
		}
	}

You basically find the src pad of your encoder and send a custom upstream event to force the key frame.

If you want this done at a regular interval then just create a background thread or timer at the required rate and make this call.

Gary.
________________________________________
From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> on behalf of Moiz <moiz at playpixel.app>
Sent: 21 October 2020 20:42
To: gstreamer-devel at lists.freedesktop.org
Subject: Re: Can't decode frames for H264 stream encoded using NVENC over RTP

I've tried adding h264parse with no avail, how can I go about setting the key
frame distance on nvh264enc? I know I can use key-int-max on x264enc but not
sure what is the equivalent on nvh264enc



--
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