I've been trying for a while but struggling. I have two projects:
Stream audio to server for distribution over the web
Stream audio and video from a webcam to a server for distribution over the web.
I have thus far tried ffmpeg and ffserver, PulseAudio, mjpegstreamer (I got this working but no audio) and IceCast all with little luck. While I'm sure this is likely my fault, I was wondering if there are any more option?
I've spent a while experimenting with Linux options and was also wondering if there were options with Python having recently played with OpenCV.
If anyone can suggest more options to look into Python or Linux based it would be much appreciated or point me at some good tutorials or explainations of what I've already used it would be much appreciated.
A good start for trying different options is to use vlc (http://www.videolan.org) Its file->transmit menu command opens a wizard with which you can play.
Another good one is gstreamer, (http://www.gstreamer.net), the gst-launch program in particular, which allows you to build pipelines from the command line.
As for me, RTSP casting is the easiest way.
GStreamer can do a lot of stuff, but you cannot start RTSP server just with gst-launch. One needs to compile an own RTSP server from gst-rtsp package. Compiling one of gst-rtsp examples will do.
Related
My goal is to create a RTSP server using OpenCV Python using the GStreamer backend.
I have RGB images stored as OpenCV Mat, and I would like to create a VideoWriter which can write to a RTSP sink. The output video must be x264 encoded.
I believe this can be easily achieved using a GStreamer pipeline and providing the pipeline arguments to the VideoWriter constructor and then later pushing frames to the VideoWriter, but the issue is I have no experience working with GStreamer and I find it very confusing.
The answers I have found on SO are incomplete, use specific hardware decoders (ex for NVIDIA Jetson), or are overly complex. I'd like to find a more generic solution which works on CPU.
I have created a project something related to your requirement sometime ago. This could be a kickstarter and customize it based on your need. I'm attaching my github repository link below.
OpenCV RTSP Server
Any issues related to the project can be raised in the github itself and doubts can be cleared here.
SimpleRTSPServer, Not in Python but very simple to run and use. Start the server in another terminal and write your outputs to there. The server easy to configure as well. You can capture read frames easily from another Python script or VLC.
I am trying to read the stream from HDMI-USB video-capture card using opencv. But OpenCV doesn't seem to support that functionality. I used opencv to read RTSP streams and webcams. Can anyone suggest a way here. Currently I am accessing the stream using OBS Studio software. Is there any other module in python that I can use. Thanks in advance.
There's a similar question here. But that approach doesn't work for me.
Edit:
video0 or video1 depends on your system and connected devices.
Turns out we can access this USB device using opencv itself.
In linux you can access these devices at /dev/video0.
import cv2
cap = cv2.VideoCapture('/dev/video0')
I'm yet to figure out how to do this in windows though
I need to check if any application is playing any kind of media. Most importantly I want my Python program to detect whichever application is playing audio.
The name of the application the audio is playing. And any related data are welcome.
I searched this up before posting here. I got many results, but unfortunately those are not for python. They were made for languages like C and C++.
My spec for your reference:
Operating System: Windows 10
Python Version 3.8
I know that video streaming is possible with python using flask framework. But as twilio is a paid platform, is there any other platforms which can be freely used for video streaming.
You can check out this blog written by miguel to develop a video steaming platform using flask.
https://blog.miguelgrinberg.com/post/video-streaming-with-flask
The theory is explained pretty well here and i personally recommend it.
If you want to some recognition or CV stuff you can also checkout tutorial by PyImageSearch.
https://www.pyimagesearch.com/2019/09/02/opencv-stream-video-to-web-browser-html-page/
I think this tutorial is more relevant for you but if you are new to python you may find this a bit overwhelming.
I would like to write a small Python script which writes a message on the console if it detects that the microphone is used by a process in Windows. I searched in the PyAudio documentation but I didn't find any solution to this. How could I solve this task? Thank you.