Using input-selector to change between multiple cameras for h264 encoding

dlw dlwalter at protonmail.com
Fri Jan 15 19:07:56 UTC 2021


I have the following pipeline with 2 cameras at different
resolutions,framerates,formats etc.

cam1(1080p, 30fps) -> videoconvert -> videorate ->capsfilter ->
input-selector.sink_0

cam2(640, 10fps) -> videoconvert -> videorate ->capsfilter ->
input-selector.sink_1

input-selector -> h264enc ->rtph264pay -> udpsink

Running either input (sink_0, or sink_1) runs fine and streams correctly,
but if I try switching while the pipeline is running the image freezes and I
can't see a camera feed.

I switch pads on the input-selector using the following:
g_object_set(G_OBJECT(bindata->input-selector), "active-pad", new_pad,
NULL);

Is there something else I need to do to the pipeline to get the stream to
work?  The pipeline also runs fine if I put the h264enc before the
input-selector, but I get some image corruption during camera switches due
to not switching on an I-frame.  I'd prefer not to use this method because I
don't want to be running multiple hw encoders at the same time.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list