Hello,
I need to live stream my webcam, I want to have access to that stream from every PC in the same network - so I thought that UDP is the perfect solution for that.
After some testing, reinstalling etc… I get that to work (I do not know if that work like UDP) :
The problem is that when I try to receive with VLC it stops working or load indefinitely (on Jetson, don’t need to work here) and give “Connection failed” + “Your input can’t be opened” (on my Windows PC where I really need it)
I tried using .sdp
You may be confusing RTSP with RTP over UDP.
test-launch will run a RSTP server. Not sure, but several clients may connect and read from it. With VLC, you would just provide the URI starting with rtsp:.
Another way is using RTP/UDP with multicast address (you may check this). In such case you would use a sdp file giving multicast address for VLC.
I think most of the latency is due to VLC itself. You may ask to VLC users forum. Quickly tried some options as here but just reduced latency from 5s to 2s with still available options.
From gstreamer receiver, you may try using rtpjitterbuffer that may try to adjust latency (in ms) sending upstream events:
# From a Jetson
gst-launch-1.0 udpsrc uri=udp://224.1.1.1:5000 auto-multicast=true ! application/x-rtp, media=video, encoding-name=H264 ! rtpjitterbuffer latency=300 ! rtph264depay ! h264parse ! omxh264dec ! nvvidconv ! xvimagesink
# From any other Linux host with ffmpeg/gstreamer libs
gst-launch-1.0 udpsrc uri=udp://224.1.1.1:5000 auto-multicast=true ! application/x-rtp, media=video, encoding-name=H264 ! rtpjitterbuffer latency=300 ! rtph264depay ! h264parse ! avdec_h264 ! xvimagesink
Can I receive that stream any other way (other than VLC)- on Windows 10? I got some application from the client to test, but I can’t receive it thru it - I wonder is that my fault or application. So I would like to test it some other way
I tried using OpenCV - VideoCapture(“udp://224.1.1.1:5000”) onmy PC but I get :
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\videoio_registry.cpp (197) cv::`anonymous-namespace'::VideoBackendRegistry::VideoBackendRegistry VIDEOIO: Enabled backends(8, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); MSMF(970); DSHOW(960); CV_IMAGES(950); CV_MJPEG(940); UEYE(930)
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (396) cv::impl::getPluginCandidates Found 3 plugin(s) for FFMPEG
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (175) cv::impl::DynamicLib::libraryLoad load H:\Moje\Pulpit\Praca\Git\TestProjects\OpenCVTest\opencv_videoio_ffmpeg451_64d.dll => FAILED
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (175) cv::impl::DynamicLib::libraryLoad load opencv_videoio_ffmpeg451_64d.dll => FAILED
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (175) cv::impl::DynamicLib::libraryLoad load opencv_videoio_ffmpeg451_64.dll => OK
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (245) cv::impl::PluginBackend::PluginBackend Video I/O: initialized 'FFmpeg OpenCV Video I/O plugin': built with OpenCV 4.5 (ABI/API = 0/0), current OpenCV version is '4.5.1' (ABI/API = 0/1)
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (256) cv::impl::PluginBackend::PluginBackend Video I/O: NOTE: plugin is supported, but there is API version mismath: plugin API level (0) != OpenCV API level (1)
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (259) cv::impl::PluginBackend::PluginBackend Video I/O: NOTE: some functionality may be unavailable due to lack of support by plugin implementation
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (262) cv::impl::PluginBackend::PluginBackend Video I/O: plugin is ready to use 'FFmpeg OpenCV Video I/O plugin'
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (396) cv::impl::getPluginCandidates Found 2 plugin(s) for GSTREAMER
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (175) cv::impl::DynamicLib::libraryLoad load H:\Moje\Pulpit\Praca\Git\TestProjects\OpenCVTest\opencv_videoio_gstreamer451_64d.dll => FAILED
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (175) cv::impl::DynamicLib::libraryLoad load opencv_videoio_gstreamer451_64d.dll => FAILED
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (396) cv::impl::getPluginCandidates Found 2 plugin(s) for INTEL_MFX
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (175) cv::impl::DynamicLib::libraryLoad load H:\Moje\Pulpit\Praca\Git\TestProjects\OpenCVTest\opencv_videoio_intel_mfx451_64d.dll => FAILED
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (175) cv::impl::DynamicLib::libraryLoad load opencv_videoio_intel_mfx451_64d.dll => FAILED
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (396) cv::impl::getPluginCandidates Found 2 plugin(s) for MSMF
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (175) cv::impl::DynamicLib::libraryLoad load H:\Moje\Pulpit\Praca\Git\TestProjects\OpenCVTest\opencv_videoio_msmf451_64d.dll => OK
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (245) cv::impl::PluginBackend::PluginBackend Video I/O: initialized 'Microsoft Media Foundation OpenCV Video I/O plugin': built with OpenCV 4.5 (ABI/API = 0/0), current OpenCV version is '4.5.1' (ABI/API = 0/1)
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (256) cv::impl::PluginBackend::PluginBackend Video I/O: NOTE: plugin is supported, but there is API version mismath: plugin API level (0) != OpenCV API level (1)
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (259) cv::impl::PluginBackend::PluginBackend Video I/O: NOTE: some functionality may be unavailable due to lack of support by plugin implementation
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (262) cv::impl::PluginBackend::PluginBackend Video I/O: plugin is ready to use 'Microsoft Media Foundation OpenCV Video I/O plugin'
[ INFO:0] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\cap_images.cpp (282) cv::icvExtractPattern Pattern: udp://%03d.1.1.1:5000 @ 224
[ INFO:1] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (181) cv::impl::DynamicLib::libraryRelease unload H:\Moje\Pulpit\Praca\Git\TestProjects\OpenCVTest\opencv_videoio_msmf451_64d.dll
[ INFO:2] global C:\build\master_winpack-build-win64-vc14\opencv\modules\videoio\src\backend_plugin.cpp (181) cv::impl::DynamicLib::libraryRelease unload opencv_videoio_ffmpeg451_64.dll
I fixed that OpenCV issue with FFmpeg (some issues with Path and compilation mode), but I still can’t connect.
.isOpened() returns false for me now. Do I specify something in the wrong way?
After all, VLC has that .sdp file with some specification, maybe I need to pass them in OpenCV as well. Or maybe that streaming command needs to be specified some other way to let me handle that way on PC?
I tried using ffplay myFile.sdp -protocol_whitelist file,udp,rtp -fflags nobuffer
which seems to be command equivalent and it’s working but that delay is back. I do not know how to set those parameters to lower the delay.
I just inform so maybe it will help somehow - I still need to receive that in OpenCV.
If I can install Gstramer on my Windows and work normally with it in OpenCV I can, so such solutions are also welcome ;P
Still I would be perfect if I could stream just to IP / Port, with no .sdp file involved at all.
I have poor experience of video and image processing with Windows, so I cannot help that much. I’d suggest you install gstreamer for your host CPU architecture. You would need the runtime binaries, but you may also install development package for rebuilding opencv with gstreamer support.
When you have the runtime installed, you may be able to try from a command shell:
Ok, I installed (following that) and tried that command - is working, unfortunetlelly no matter what latancy I set I still gat quite a big lag.
When I try to use OpenCV version I get
[ WARN:0] global F:\Code\opencv_4.5.1\opencv-4.5.1\modules\videoio\src\cap_gstreamer.cpp (734) cv::GStreamerCapture::open OpenCV | GStreamer warning: Error opening bin: no element "udpsrc"
[ WARN:0] global F:\Code\opencv_4.5.1\opencv-4.5.1\modules\videoio\src\cap_gstreamer.cpp (501) cv::GStreamerCapture::isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
And .isOpened() give me false.
I’m don’t know if I installed something wrong?
Seems the gstreamer pipeline failed to be created because udpsrc plugin was not found. Did that work from shell as suggested in my previous post ? You may check setting the environment variables such as PATH.
This is more a general topic about using gstreamer in opencv from Windows, not Jetson-specific, so you may get better help asking to opencv forum.
@Honey_Patouceul
Maybe you know some other solution that I may try, I searched so much that don’t even know what to search for anymore, do you maybe have any other hint for me?
I tried asking elsewhere but without success - you are my best bet right now, sorry to bother you again.