Losing background after seek in using compositor

Here’s my pipeline setup:

data.p1 = gst_parse_launch(
        "filesrc location=/path/to/video.avi ! decodebin name=dec "
        "dec. ! videoconvert ! video/x-raw,format=BGRA! intervideosink channel=background "
        "dec. ! audioconvert ! audioresample ! queue! volume name=base_volume !autoaudiosink", NULL);

    data.p2 = gst_parse_launch(
        "filesrc location=/path/to/overlay.webm ! matroskademux ! queue ! parsebin ! vp9alphadecodebin ! "
        "videoconvert ! video/x-raw,format=BGRA ! "
        "videoscale ! videorate ! "
        "video/x-raw,width=640,height=400,framerate=60/1 ! "
        "queue ! intervideosink channel=overlay_2", NULL);

    data.p3 = gst_parse_launch(
        "compositor name=comp "
        "sink_0::zorder=0 "//no other specs
        "sink_1::width=640 sink_1::height=400 sink_1::zorder=1 "
        "sink_2::width=640 sink_2::height=400 sink_2::zorder=2 "
        "! video/x-raw,format=BGRA,width=640,height=480,framerate=60/1 "
        "! videoconvert ! queue ! gtksink name=videosink "
        "intervideosrc channel=background ! comp.sink_0", NULL);

    data.comp = gst_bin_get_by_name(GST_BIN(data.p3), "comp");

Apparently at random, after seeking on “p1” the “p1” video sometimes disappears and the checkered background appears, while the overlay continues to play, as does the audio track of the background video. I can’t identify any relevant info in debug output (due to my lack of understanding, I’m sure).

When seeking on the “background” video, are there any special flags or sequence of setting the pipeline state before/after a seek when using the compositor pipeline?

Does adding sink_0::max-last-buffer-repeat=-1 to compositor’s sink_0 pad in p3 help here ?

I’ll give it a try tomorrow, thanks :grin:

It does seem to help! I’m not sure if it’s that or other code fixes I’ve done that might have been the problem, but the video is seeking as expected and not disappearing now! :grinning: Thank you so much for thinking about it! I’m curious, where in the documentation is that buffers setting?

Glad if it helped, but unsure as this may just be the default value… see below

Just see:

gst-inspect-1.0 compositor
...
Pad Templates:
  SINK template: 'sink_%u'
  ...
  Type: GstCompositorPad
  Pad Properties:
  ...
    max-last-buffer-repeat: Repeat last buffer for time (in ns, -1=until EOS), behaviour on EOS is not affected
                            flags: readable, writable, changeable in NULL, READY, PAUSED or PLAYING state
                            Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 18446744073709551615 

Ah, thanks. Yeah, not sure - I’m running the app a lot, so far I lost the video just once today, still trying to debug … :man_shrugging:t3: