diff --git a/modules/videoio/src/cap_gstreamer.cpp b/modules/videoio/src/cap_gstreamer.cpp index 1e2339eac..7c2852963 100644 --- a/modules/videoio/src/cap_gstreamer.cpp +++ b/modules/videoio/src/cap_gstreamer.cpp @@ -874,8 +874,8 @@ bool CvCapture_GStreamer::open( int type, const char* filename ) fps = (double)num/(double)denom; // GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(pipeline), GST_DEBUG_GRAPH_SHOW_ALL, "pipeline") - - stopPipeline(); + if (file) + stopPipeline(); } __END__;