How to change the "preview/first" image shown for videos?

Hi and sorry for the beginner question, I am creating an application with a pipeline like this

(udpsrc → rtpvp8depay → vp8dec) \
(udpsrc → rtpvp8depay → vp8dec) → compositor → vp8enc → matroskamux
(udpsrc → rtpvp8depay → vp8dec) /

Basically a webcam capture. The image shown for the video in OS file explorer and video players is the first frame (preroll?). I would like to create my own, something like a background with a logo and a date. How would i go about doing that? Thank you. My first instinct would be to first create elements to make that image, send a single buffer to the vp8enc and then link the other elements, but it seems… “hack-ish”?

The fallbacksrc (rust plugin) has an example of how to use a static image to fall back to (or use initially) when your other stream is not ready or drops, so you can lift the code from there. Alternatively you can use the fallback src, and wrap the udpsrc etc in a bin, but a bit more complex (however significantly more robust if executed well)

I have no idea about rust, I am getting the code but i did not expect 2k LoC for this, thanks. Assuming I used this element, what would the process be, send a single image as a 0 duration buffer to the matroskamux then let the other sources play?

Fallbacksrc is large because it does a lot, I used it as an example because it is relatively robust and a lot of the issues it tries to solve sit in your future if you want to be somewhat resistant to things going down.

Another approach

  1. use an input_selector element to switch between the image and the video source
  2. I would use a compositor before the input selector to ensure the input selector always gets video content - look at ignore-inactive-pads
  3. I would decouple the distribution part of my pipeline from the contribution

and then based on what is coming in I would use the input_selector.