bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
10.78k stars 1.4k forks source link

rtsp connection problem from openCV c++ #3187

Closed MyraBaba closed 1 month ago

MyraBaba commented 3 months ago

Which version are you using?

bluenviron/mediamtx:latest

Which operating system are you using?

ubuntu 22.04

Describe the issue

Description

Describe how to replicate the issue

Hi,

I starting docker :

docker run --rm -it --network=host bluenviron/mediamtx:latest

and publishing the video :

ffmpeg -re -stream_loop -1 -i /home/acc//4K_1920.ts -c copy -f rtsp -rtsp_transport tcp rtsp://localhost:8554/mystream

I can see with ffplay but it waits 5-10 seconds to start.

on the other hand I cant connect through c++ openCV cap.open..

the c++ code connect normal camera rtsp but cant connect rtsp://localhost:8554/mystream .

Best

ERROR: [ WARN:4] global ./modules/videoio/src/cap_gstreamer.cpp (963) open OpenCV | GStreamer warning: cannot find appsink in manual pipeline [ WARN:4] global ./modules/videoio/src/cap_gstreamer.cpp (616) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created [ERROR:4] global ./modules/videoio/src/cap.cpp (164) open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.5.4) ./modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): rtsp://127.0.0.1:8554/mystream in function 'icvExtractPattern'

Error opening video sources video Okundu - 2

  1. start the server
  2. publish with ...
  3. read with ...

Did you attach the server logs?

no

Did you attach a network dump?

no

aler9 commented 1 month ago

Hello, the problem is explained in the log returned by OpenCV:

[ WARN:4] global ./modules/videoio/src/cap_gstreamer.cpp (963) open OpenCV | GStreamer warning: cannot find appsink in manual pipeline

There's an error inside your OpenCV script (which you have not posted) that is preventing OpenCV to correctly interact with any RTSP server. This is not bound to this specific server.