force keyframe ignored (v4l2h264enc)

Nicolas Dufresne nicolas at ndufresne.ca
Tue Mar 23 12:23:58 UTC 2021


Le mar. 23 mars 2021 05 h 30, Javiku <javier.carrasco at wolfvision.net> a
écrit :

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

This is not yet implemented in this element, in fact there wasn't yet
support for this in Linux when that element was posted. I can provide you
hints on how to implement support for that, it should be fairly
straightforward.



>       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/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210323/84d990e0/attachment.htm>


More information about the gstreamer-devel mailing list