force keyframe ignored (v4l2h264enc)

Javiku javier.carrasco at wolfvision.net
Tue Mar 23 08:19:36 UTC 2021


Hello,
I tried to implement the solution proposed in 
http://gstreamer-devel.966125.n4.nabble.com/How-to-force-keyframes-using-Python-GST-bindings-td4695810.html
<http://gstreamer-devel.966125.n4.nabble.com/How-to-force-keyframes-using-Python-GST-bindings-td4695810.html>  
but my "v4l2h264enc" encoder seems to ignore the event I send and no extra
key frames is generated. I just added a function to get a pointer to the
encoder and some messages that in fact are never displayed because the
conditions are always false. This is my code:

      ForceKeyStruct = gst_structure_new("GstForceKeyUnit","all-headers",
G_TYPE_BOOLEAN, TRUE, NULL);
      if(ForceKeyStruct == NULL)
        ipcd_warn("ForeKeyStruct NULL");
      force_key_unit_event = gst_event_new_custom(GST_EVENT_CUSTOM_UPSTREAM,
ForceKeyStruct);
      if(force_key_unit_event == NULL)
        ipcd_warn("force_key_unit_event NULL");
      enc = gst_bin_get_by_name(GST_BIN(pipeline), "v4l2h264enc0");
      if(enc == NULL)
        ipcd_warn("enc NULL");
      encoder_src_pad = gst_element_get_static_pad(enc, "src");
      if(!gst_pad_send_event(encoder_src_pad, force_key_unit_event))
        ipcd_warn("event not sent");
      gst_object_unref(encoder_src_pad);

When this code is executed I do not notice any change... as if the event was
completely ignored. The frame pattern does not change and I do not get any
additional key frame. I do not get any error message either. Am I doing
anything wrong? Is my encoder not able to handle that event? should I
explicitly configure the encoder to accept this event? Thanks in advance.
Regards Javiku




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


More information about the gstreamer-devel mailing list