How to stream a video using python and opencv without twilio? - python

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.

Related

How to create x264 RTSP server with OpenCV Python with GStreamer backend

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.

Is there a straightforward way to make calls to a Python or NodeJS API using Swift for an Apple Watch App?

I need to propose a project for a class soon, hence why I'm asking about something I know so little about without doing a ton of research upfront. I would like to build an Apple Watch App. The function of the application that I have in mind is fairly straightforward, but would require the use of an API that is available in a Python version and a Node.js version. Is this possible to integrate calls to the API (in either language) into the watch application's functions, and if so, what does that broadly look like?
EDIT: As pointed, out, I did not include enough info about the API. It is publicly available and hosted on the internet. I'm looking to use the emotion recognition API developed by Deepaffects which can be found at https://developers.deepaffects.com/

How to use Firebase with a linux based client app for bidirectional messages communication with server

I've seen Google's documentation and a lot of examples over the internet about how to use Firebase within Android / iOS applications, but I want to develop a client Firebase application which runs on a linux machine.
My requirements are:
Client runs on linux environment (either writtern in C++ or python).
Server is written in Javascript (NodeJS).
Server and client should have bi-directional communication between them using firebase realtime database.
I've seen also the firebase REST api, but I assume that is not good enough for me since I haven't seen a client listener api that listens on a something like onValueChanged.
Question:
How can I implement a linux-based app in C++ or python that listens to messages from server (data changes) using a listener, without having to call some get function each and every few seconds (just like NodeJS have the ref.on("child_changed",...) or ref.on("value",...)?
Help is much appreciated!
Unfortunately there is not official library for Realtime Database in Python but there are some third party wrappers around REST API.
Specifically I would look at Pyrebase library which also supports listening to live changes https://github.com/thisbejim/Pyrebase#streaming
For more information, libraries or other languages look at this page https://firebase.google.com/docs/database/rest/start
Google offers a C++ SDK you can download it here.
There is also a tutorial on the bottom of the page, but if you really want to dig into some code, here is the quickstart code on github from google with examples for each category on Firebase.
Google has also implemented a Game for demonstration purposes in C++ for Desktop OSs. here There you can find more advanced features and code samples.
I have only tried it with an XCode project on Mac OS X, and it works fine. I have no code for real time database but you should find the sample project in the github repo. https://github.com/firebase/quickstart-cpp
I hope this helps!
Greetings.
Haven't you try to use a Realtime Database triggers for C++ (that's is currently on beta) that allows you to simulate the same workflow as on JS?
From my point of view, it is the best way to get it to work as you want.
https://firebase.google.com/docs/functions/database-events

Streaming audio and video

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.

Google Talk/XMPP audio support in Python

I'm looking for a Python library to communicate with Google Talk that can handle audio chat. There are plenty of them that can do text-only, but I can't find any that support audio or video. Does anyone know of one?
You need a library in Python that has bindings for jingle, which is the standard for voice over xmpp. There are build instructions available to create Python bindings.

Categories