ros-drivers / video_stream_opencv

A package to open video streams and publish them in ROS using the opencv videocapture mechanism
227 stars 159 forks source link

Publishing from a gimble camera #109

Open hichamhendy opened 3 years ago

hichamhendy commented 3 years ago

I am trying to publish a topic from a rtsp link but I got the error

[FATAL] [1626767105.585861559]: Invalid 'video_stream_provider': rtsp://192.168.0.201:554/live0

When I try with vlc or gstream it works fine through the following command gst-launch-1.0 -v rtspsrc location=rtsp://192.168.0.201:554/live0 drop-on-latency=true use-pipeline-clock=true do-retransmission=false latency=0 protocols=GST_RTSP_LOWER_TRANS_UDP ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink sync=true

but anyway, i want to to publish the stream on topic: By the way I tried with webcam and it also works fine! Only with rtsp

awesomebytes commented 3 years ago

If that gstreamer string works for you, you could try to use the ROS package gscam

Not sure why you get that error!

On Tue, Jul 20, 2021, 17:49 Hesham Hendy @.***> wrote:

I am trying to publish a topic from a rtsp link but I got the error

[FATAL] [1626767105.585861559]: Invalid 'video_stream_provider': rtsp:// 192.168.0.201:554/live0

When I try with vlc or gstream it works fine through the following command gst-launch-1.0 -v rtspsrc location=rtsp://192.168.0.201:554/live0 drop-on-latency=true use-pipeline-clock=true do-retransmission=false latency=0 protocols=GST_RTSP_LOWER_TRANS_UDP ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink sync=true

but anyway, i want to to publish the stream on topic: By the way I tried with webcam and it also works fine! Only with rtsp

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ros-drivers/video_stream_opencv/issues/109, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANEK5GVFNOBJ43MOVQSF2TTYUS65ANCNFSM5AVH32ZQ .

hichamhendy commented 3 years ago

Do I need to provide you with more info about the error?

awesomebytes commented 3 years ago

Maybe show the launchfile?

You can also try to use the Python test file to see if that works. The backend is also opencv so it should provide the same results.

The error seems to from from opencv, so maybe there's some trick to format the rtsp stream string?

On Tue, Jul 20, 2021, 18:01 Hesham Hendy @.***> wrote:

Do I need to provide you with more info about the error?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ros-drivers/video_stream_opencv/issues/109#issuecomment-883185107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANEK5DPNKRRXGLK3DEXAM3TYUUL3ANCNFSM5AVH32ZQ .

hichamhendy commented 3 years ago

Here it is: arg name="video_stream_provider" value="rtsp://192.168.0.201:554/live0"

I didn't change much in there! only added my rtsp link, Should I have done something else?

From test_video_resource, I get: resource.py rtsp://192.168.0.201:554/live0 ('Trying to open resource: ', 'rtsp://192.168.0.201:554/live0') Error opening resource: rtsp://192.168.0.201:554/live0 Maybe opencv VideoCapture can't open it

awesomebytes commented 3 years ago

Looks like opencv can't open it!

Too bad. I hope gscam works for you

On Tue, Jul 20, 2021, 19:37 Hesham Hendy @.***> wrote:

Here it is: arg name="video_stream_provider" value="rtsp:// 192.168.0.201:554/live0"

I didn't change much in there! only added my rtsp link, Should I have done something else?

From test_video_resource, I get: resource.py rtsp://192.168.0.201:554/live0 ('Trying to open resource: ', 'rtsp://192.168.0.201:554/live0') Error opening resource: rtsp://192.168.0.201:554/live0 Maybe opencv VideoCapture can't open it

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ros-drivers/video_stream_opencv/issues/109#issuecomment-883250543, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANEK5C3CPPEPGILLSCJ5OLTYU7VRANCNFSM5AVH32ZQ .