Getting video encoded and decoded data in sync

I have a pipeline having multiple rtpssrc element. Each input have the processing as the fallowing:

rtspsrc -> tee -> 
1.  splitmuxsink (muxer = mp4mux)
2. decodebin -> ... -> multifilesink (save jpg)

I have unpredictable delay between splitmuxsink and multifilesink.

Once I get new jpg, I save it over the same path. After an app signal i will copy the last picture so that becomes persistent.

The problem is that, I need to find saved picture position in mp4.

I am wondering if it is possible.

I have an idea to add id to key-frame. Save it to mp4 container and jpg (even in filename).

Please, share some ideas of how to make it.

Thanks, in advance. :slight_smile:

Instead of using a tee, I’d just use a simple pipeline rtspsrc ! splitmuxsink, then whenever you have a mp4 generate, I’d generate the jpeg using a pipeline like uridecodebin ! identity eos-after=1 ! jpegenc ! filesink, which should generate exactly one image file form the first frame of the video.