Giter VIP home page Giter VIP logo

opencv-rtsp-server's Introduction

Hola 👋

This is Prabhakar Sivanesan, an experienced Researcher and Developer in the field of Computer Vision and Deep Learning. Love to brainstorm, ideate and develop smart solutions for real world problems.

Profile Summary

Prabha's GitHub stats

Technology Stack

                                                  

opencv-rtsp-server's People

Contributors

prabhakar-sivanesan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

opencv-rtsp-server's Issues

prerequisites question

Hi,
thanks for your code!

I fail to run your code as the gi package cannot be found. I understand it requires the python packages PyGObject and pycairo.
The environment is a docker container of python:3.9.2-slim-buster.

On the Dockerfile I have the following install commands:

RUN apt-get update && apt-get install -y
RUN apt-get install ffmpeg libsm6 libxext6 -y
RUN apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio -y
RUN apt-get install libglib2.0-dev libgstrtspserver-1.0-dev gstreamer1.0-rtsp -y

RUN pip install opencv-python
RUN pip install pycairo
RUN pip install PyGObject

and then I added also RUN apt-get install libcairo2 -y just before the pip commands and also other intents but they all fail with:

#11 28.26 Building wheels for collected packages: pycairo
#11 28.27   Building wheel for pycairo (pyproject.toml): started
#11 30.94   Building wheel for pycairo (pyproject.toml): finished with status 'error'
#11 30.96   error: subprocess-exited-with-error
#11 30.96
#11 30.96   × Building wheel for pycairo (pyproject.toml) did not run successfully.
#11 30.96   │ exit code: 1
#11 30.96   ╰─> [17 lines of output]
#11 30.96       running bdist_wheel
#11 30.96       running build
#11 30.96       running build_py
#11 30.96       creating build
#11 30.96       creating build/lib.linux-x86_64-cpython-39
#11 30.96       creating build/lib.linux-x86_64-cpython-39/cairo
#11 30.96       copying cairo/__init__.py -> build/lib.linux-x86_64-cpython-39/cairo
#11 30.96       copying cairo/__init__.pyi -> build/lib.linux-x86_64-cpython-39/cairo
#11 30.96       copying cairo/py.typed -> build/lib.linux-x86_64-cpython-39/cairo
#11 30.96       warning: build_py: byte-compiling is disabled, skipping.
#11 30.96
#11 30.96       running build_ext
#11 30.96       Package cairo was not found in the pkg-config search path.
#11 30.96       Perhaps you should add the directory containing `cairo.pc'
#11 30.96       to the PKG_CONFIG_PATH environment variable
#11 30.96       No package 'cairo' found
#11 30.96       Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
#11 30.96       [end of output]
#11 30.96
#11 30.96   note: This error originates from a subprocess, and is likely not a problem with pip.
#11 30.96   ERROR: Failed building wheel for pycairo
#11 30.96 Failed to build pycairo
#11 30.96 ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects

Any idea how to solve this?

Thanks!

Script on Mac fails with appsrc error

When launching the script from MacOS it fails with

(<unknown>:18406): GStreamer-RTSP-Server-CRITICAL **: 09:01:15.865: could not create element Traceback (most recent call last): File "stream.py", line 59, in do_create_element return Gst.parse_launch(self.launch_string) gi.repository.GLib.Error: gst_parse_error: no element »appsrc« (1)
I've installed gstreamer (and plugins) with homebrew. I also installed
pip install gobject PyGObject

Only works with 640x480 output resolution.

I was able to run the script using the default arguments and connect to and view the RTSP stream, and it was working correctly.
However, as soon as I change the output resolution of the RTSP stream by modifying the --image_width and --image_height arguments in the bash script, then when I connect to the generated RTSP stream, it either only displays a green image, or freezes immediately while displaying strange artifacts:

image

Installation of GStreamer and RTSP server

I don't know if you're developing this any further but in case you do, what do I need to do to install GStreamer and RTSP server on Ubuntu 20.04?
Also my installation on Ubuntu 18.04 failed: It said that libgstrtspserver-1.0-dev could not be installed because of dependecies that failed to install. Is there a fix for that (the internet couldn't show me anything fitting)?

How can I use rtpvrawpay?

Hi.

I'm trying to implement a rtsp server which sends loseless real image.

I tried the launch_string as below, and I cannot get open video in the client.

Can you help me out?

Thanks!

    self.launch_string = 'appsrc name=kinect is-live=true block=true format=GST_FORMAT_TIME ' \
                         'caps=video/x-raw,format=BGR,width={},height={},framerate={}/1 ' \
                         '! rtpvrawpay' \
                         .format(opt.image_width, opt.image_height, self.fps)

RTSP over HTTP

Is it possible to configure GstRtspServer to use the HTTP protocol? I can connect through UDP and TCP but I really need HTTP.

Cannot open camera from open_rstp.py

I am having troubles when I try running open_rtsp.py. I have stream.py running in one terminal with the following command python3 stream.py --device_id 0 --fps 30 --image_width 640 --image_height 480 --port 8554 --stream_uri /video_stream.

In the terminal of where I am running open_rtsp.py, I am getting error OpenCV(4.5.5) /io/opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): rtsp://192.168.1.7:8554/video_stream in function 'icvExtractPattern'

How to do variable frame rate.

This is not really an issue but more of a question.

I see that on this line, you are setting the frame rate.

Do you know how one could go about using a variable framerate?
In my setup, I grab a frame from an RTSP stream, perform some processing, then restream the processed frame as a new RTSP stream.

The issue is that the processing I perform can vary based on the image received from the RTSP stream and hence is not a constant time, so it's therefore not possible to achieved a fixed frame rate.

Viewing Video file instead of webcam

Thanks for the great work.

i am trying out your work and noticed that if i changed the videocapture instead of device 0 but to a video file, the output is green screen. Can advise? thank you

Program doesn't run properly

I tried to use the library.
I am trying to stream from a CCTV using RTSP stream.
Once the command starts run

python stream.py --device_id "rtsp//xxxxx" --fps 30 --image_width 640 --image_height 480 --port 8554 --stream_uri /video_stream

SensorFactory's init method run.
But on_need_data(), do_create_element(), do_configure() methods didn't run.

What could be issue?

How to start the server in the backgroud?

Hi @prabhakar-sivanesan Awesome project,
I have a question, I noticed the RTSP stream only starts when a connection is made. For example, only starts when I connect to the stream via VLC and stops when I stop the stream (or close VLC).
How can I make the rtsp server run in the backgroud without having to open VLC?

I added the following line but doesn't seem to make a difference:
.set_state(Gst.State.PLAYING)

Stream from a Python PIPE output

Hello,
i'm iterested in your project but i'm finding a way to stream the output from one python to your server.
For now i can see the video with FFMPEG using this command:
python streamcamera.py | ffplay -i pipe:

If i run the script with this command python streamcamera.py i have the video feed output.

Thanks a lot
Stefano

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.