I tried the way using v4l2loopback. But my program failed.
v4l2loopback installation had probably succeeded.
[s]My program error message is as followings.
OpenCV Error: Unspecified error (GStreamer: cannot put pipeline to play) in CvVideoWriter_GStreamer::open,
file /home/nvidia/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp, line 1696
VIDEOIO(cvCreateVideoWriter_GStreamer (filename, fourcc, fps, frameSize, is_color)): raised OpenCV exception:
error: (-2) GStreamer: cannot put pipeline to play in function CvVideoWriter_GStreamer::open
Could not open the output video file for write
And pseudo cmd message is as followings.
$ gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,format=BGRx ! identity drop-allocation=true ! v4l2sink
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Cannot identify device '/dev/video1'.
Additional debug info:
v4l2_calls.c(609): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
system error: No such file or directory
Setting pipeline to NULL ...
Freeing pipeline ...
Above error occured by forgetting “sudo modprobe v4l2loopback”.
I have done test-launch and check client.
But no image displayed.
So I tested “gst-launch-1.0 v4l2src device=/video0 ! nvvidconv ! queue ! nvelgltransform ! nveglglessink”.
This displayed an image(not movie).
Finaly, I could stream and receive.
The error is caused by sync of sink is true.