Best option to add overlay, ensure frame rate (fallback source), handle need callback, and frame transfer in GStreamer

Israel Díaz via gstreamer-devel <[email protected]>
Newsgroups gmane.comp.video.gstreamer.devel
Message-ID <CALyc=cM-nFvKNTJXXS8zL_4eDH80Pi4WrAtXvYDr9tk6W87XaA@mail.gmail.com>
Hello,

I'm working with GStreamer and have a pipeline that captures video from a
v4l2src device and sends it to an appsink. Currently, I receive the frames
through the new-sample callback of appsink. I need to add a simple overlay
before sending the frames to another pipeline with omxh264enc.
Additionally, I would like to ensure that the frames arrive at a rate of 30
fps.

My current pipeline is as follows: v4l2src device=/dev/video1 io-mode=4 !
video/x-raw,width=1920,height=1080,format=NV16_10LE32,framerate=30/1 !
appsink name=videosourcesink

And the next pipeline is: appsrc name=encodersource !
video/x-raw,width=1920,height=1080,format=NV16_10LE32,framerate=30/1 !
omxh264enc target-bitrate=8000 num-slices=2 periodicity-idr=30 !
video/x-h264, alignment=au ! appsink name=encodersink

I have the following questions:

   1.

   What would be the best approach to add an overlay in the first pipeline
   before sending the frames to the second pipeline?
   2.

   Is there a way to ensure that the need-data callback of appsrc is called
   at a rate of 30 fps? Or should I consider an alternative approach, such as
   restarting a timer every time a frame is received from v4l2src and, in case
   of a timeout without receiving frames, generating the test pattern at that
   moment?
   3.

   Currently, I'm receiving the frames through the new-sample callback of
   appsink, and then I add the frames to appsrc using gst_app_src_push_buffer.
   Is this the recommended method for frame transfer in this scenario, or are
   there other approaches I should consider?

I would greatly appreciate any guidance or recommendation on these three
aspects, considering both efficiency and effectiveness.

Thank you in advance!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.