VideoWriter output to Google Cloud Storage - python

I am creating a web application that makes animation from frames. I use opencv and VideoWriter to implement it. But there is a problem. I want to host my application on Google App Engine, so I cannot save files on it. Is it possible to output the VideoWriter video to Google Cloud Store directly, without saving it on the machine, or I must find other library to implement it?

Generally speaking, streaming transfers are supported by Cloud Storage for other languages, but for Python, or Ruby. OpenCV has C++, Python, Java and MATLAB interfaces and supports Windows, Linux, Android and Mac OS. In other words, if you don't plan to use the Python, or Ruby library version, your setup should work.

Related

How can I access my laptop's built-in infrared webcam using python?

I'm trying to access my laptop's built-in infrared webcam (intended for windows hello) in a python project. I can access the normal RGB camera quite easily using the VideoCapture class from OpenCV, however can't find a way to access the infrared camera. I tried passing different indices to the VideoCapture class, however only "0" works, which is the normal webcam.
There are ways to do this using the Windows API, however I can't find a way to access this in Python.
Some people have been able to access the windows hello camera on Ubuntu using fswebcam.
Is there anyway to access the infrared camera using python? Maybe some way of interfacing with the Windows API using pywin32? Any help getting started with this would be appreciated. Alternatively, is there anything similar to fswebcam for Windows that would let me do the same?
That example you provided, doesn't seem to use the win32 api, but rather the dotnet framework, specifically the Windows.Media.Capture.Frames.MediaFrameSourceGroup class.
It looks like you'll be able to access the dotnet framework using http://pythonnet.github.io/ . After that it should be a case of porting that C# code over to Python.
You need to access WinRT API, not Win32 API.
Use this library: https://github.com/Microsoft/xlang/tree/master/src/package/pywinrt/projection and you should be able to call invoke necessary parts in WinRT from the code you posted.

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

Django: speech to text application

first do you know what language google used to create the speech to text search?
then can you create a speech to text django or google apps engine using python? i'm not a vb.net programmer and yes i know that such applications are usually created in java, couldn't they be created in jython? i have a django app i would like to introduce this feature to it.
i can use ispeech (not free!) or similar services, but before working with APIs (i don't like working with APIs to be honest unless it is facebook or google API), i'm looking to see if there's a python or jython library for that (i prefer python)
i found so far pyspeech it works on windows and my vps is linux so won't do me any good
Unlikely.
As you cannot install binaries in the Google App Engine environment, you would need build an entire speech recognition engine from scratch. This would be ..non-trival.
If you are not limited to Google App Engine however, there are Python bindings to existing packages, such as Sphinx

Sever Side convert SVG to PNG or JPG image with Python on Google Application Engine

How to convert SVG to PNG or JPG image with Python on Google Application Engine?
Any idea?
Google Application Engine has PIL support. However, PIL doesn't support SVG.
When working with Google App Engine you will need a pure Python library because you can't install anything that's compiled (eg. Cairo). While there are pure Python libraries for creating SVG files (eg. pySVG) I don't think there are any for rasterizing SVG images.
If you manage to find (or write) a pure Python library to do this, it is likely to be prohibitive to run it on GAE due to the amount of computation required and the request time restrictions.
I would consider hosting the image conversion service elsewhere and have the GAE fetch the PNGs from there

Python: Windows registry hive access NOT using registry APIs

I am trying to extract some data out of the Windows registry, both the software hive and ntuser.dat from XP computers. Currently I'm using reg.exe to load the hive and _winreg to extract the data. I need to use reg.exe as the computers I'm backing up data from are usually offline and I'm putting the hard drive from them in an external drive bay and loading the hives from that in another Windows session. It's not feasible to boot up the computers being backed up as they are often failing hard drives or otherwise unbootable.
I've seen a utility called hivex which runs under Linux which combines a c-module with a python wrapper to allow for read-only (limited write) access to the Windows registry, without using the Windows Registry APIs. Sadly there doesn't appear to be a Windows version of hivex, assumingly because no one figured a need to access the Windows registry under Windows by directly accessing the hive files.
I'd love to drop the dependency of reg.exe being called by subprocess.Popen() as calling an external executable has a host of issues, plus it makes the backup utility platform limited.
Does anyone know of a python module which allows for direct access of the hive files themselves? I already know of, and am currently using _winreg, so suggesting that would be less than helpful. Thanks in advance.
I'm not sure how much better it is, but the pywin32 library supplies bindings to most of the windows API. I don't know the windows API well enough to know if you can open arbitrary hive files, however it could be worth a quick look (the release contains a CHM with the full API mapping).
Did you have a look to regobj it provides pythonic access to registry value (but it is still based on _winreg)
Is your problem with calling an external application or using the registry APIs? If it is the former you can load and unload hives yourself using RegLoadKey / RegUnLoadKey. If it is the latter then I'm sure somebody has written a C library to parse hives directly. A quick Google search gave me Microsoft's Offline Registry Library.

Categories