RidgeRun / gst-interpipe

GStreamer plug-in for interpipeline communication
Other
143 stars 64 forks source link

Low framerate when "rtspsrc" run with delay #73

Open keivanh opened 3 years ago

keivanh commented 3 years ago

I am trying to create something like this, to switch between live feed and test pattern image (to show live is not available):

videotestsrc -> interpipesink  ------- interpipesrc -> ximagesink
rtspsrc -> interpipesink -------------|

video test pattern starts immediately and pipeline waits for rtspsrc to connect, it might be any time during application lifetime. For test I wait 10 seconds and then start the rtspsrc pipeline, after switch output video framerate drops to ~1 fps.

I have tested with both source as "videotestsrc" and it works fine (I followed this example)

It only happens when second source is rtspsrc and its pipeline starts with some delay. When I start both pipelines at same time it works fine.

Here are my pipelines:

std::string testSource = "videotestsrc is-live=true ! videoscale ! video/x-raw,width=1280,height=720 ! queue ! interpipesink name=offlineSource caps=video/x-raw,width=1280,height=720,framerate=30/1 sync=false async=false";

std::string exitNode = "interpipesrc name=exitNode listen-to=offlineSource is-live=true allow-renegotiation=true stream-sync=compensate-ts ! tee name=raw-video-splitter ! queue ! fpsdisplaysink async=false sync=false";

std::string rtspSource = "rtspsrc location=<RTSPURI>  latency=50 ! rtph264depay ! h264parse ! avdec_h264 max-threads=10 ! videoconvert ! videorate ! "
                            "video/x-raw,width=1280,height=720,framerate=30/1 ! queue leaky=downstream ! "
                            "interpipesink name=liveSource caps=video/x-raw,width=1280,height=720,framerate=30/1 sync=false async=false";

Do you think this is something related to interpipe plugin or rtsp source?

keivanh commented 3 years ago

Update: I managed to solve the problem by setting interpipesrc stream-sync=passthrough-ts . Still I am not sure if this is correct way of doing this or not?

Now when I switch back to videotestsrc I get static corrupted image.