I want to have a F-key activated script to control OBS Studio rather than a user - scripting

I am attempting to provide my church with video streaming to Facebook using a PTZ camera and OBS Studio. The goal is to allow non-computer-literate people to start it up. I've already got the program to autostart on boot. There are several config point and clicks to get it to start the stream and I need some directions how to accomplish. I've thought about using key/mouse recorded macros and just have the user push a F-key to run the macro. It gets complicated if window placement, size, position, etc. changes from boot to boot, then the macro won't be able to locate the correct mouse click locations and so won't accomplish the desired effect.
My question and quest for posting here is, since OBS Studio is open source, is there anybody here that could help me accomplish the key presses and mouse clicks by some kind of Python script that could effect these steps directly by manipulation of the code within OBS Studio application?

Related

Automatically select video source from dialog? VB.net

I've been playing with a generic usb camera to take snapshots every few seconds. With the help of this SO question, I was able to get the camera working; however, when you click the button to connect to the camera, a dialog box appears.
The difference between the other question and my question is that I have two video sources: a built in webcam and a usb camera. I also intend to have multiple cameras connected, all taking pictures. It appears that when you have multiple devices, you always get the dialog box where you have to choose the device. I'm trying to automatically choose the camera (and eventually cameras, plural) without this dialog box.
There are other pieces of sample code that I have played with - samples that have a device listbox that is populated; I thought this was what I needed (and I'd just remove the listbox control and process the list and what to connect to in code), but every one of these samples populates the listbox with "Microsoft WDM Image Capture (Win32)" instead of the devices listed in the dialog after attempting to connect to this "device."
Surely there's a way to automate the webcam(s) I'm connecting to instead of having to choose it from a dropdown in a Windows dialog, right? How would I go about doing this?
The solution ultimately was to use EMGU to access the camera; this also allows for connecting to multiple cameras at the same time.

Kill application not Process - VB

I have a program that out of my control will bring up a message box (I didn't write or have source code)
I am trying to find out if it is possible to write a program (visual studio) that can at a set time, say every 10 minutes close all open applications(msgbox) but keep the process going? The application/task name is different to the process name.
It runs on XP and 7.
I've tried google but haven't managed to find what I'm after, all i can find is process kill. Not 100% sure on correct terminology.
You might be better-off writing a program that finds a current open dialog (window, messagebox, etc) and closing it. Sending an Esc keystroke is a pretty easy approach. Here is another SO article that talks about doing this: How to send a mouse click event to a hidden window?

VB.Net automate flash in WebBrowser

I've passed many hours searching the web for a solution to something which seems obvious, but without results.
I need to automate a task in a Flash application running on my intranet.
I can't change the Flash application nor do I have access to the source code.
it's not a Flash movie but an application.
I can't download the swf.
I'm using a WebBrowser in a form. The Flash app is displaying without issues.
So far, I have been able to automate the task (clicking on some buttons, then inputting text and finally saving the results on a server). It works but it's not clean at all because I use hard-coded timers to wait a given action is done and then I click on very specific point at given coordinates in the application.
What I would like to do:
Avoid hard-coded timers. the Flash application takes some time to display all elements on the window (from 20 to 60+ sec). I would like to be able to detect when all elements are loaded. I tried to retrieve the text of the windows handle, but while I can retrieve the Flash hwnd, I can't retrieve the content (through messages).
In brief, instead of waiting 60sec (and not being 100% sure it's enough), if the last element to load in the Flash app has "ABC" written in it, I would like to detect it's displayed so that I can continue the sequence (click on the next button).
I'm using VB.net. Any hints to achieve that would be appreciated.
Lol. I am trying to do the same thing but with no results. You can try to see if there are POST/GET codes that can help you if the application has an online nature. Other than that you can only simulate clicks, because flash can't be easily interacted with. This is why most of the things are going to swap with HTML5 now.

In GNU screen, is it possible to programmatically read the status message?

I am considering writing a graphical tool that will show you what gnu-screen sessions you have and what windows are available in them. You would then be able to, for example, click on the window title and it would take you there. I do not want to modify gnu-screen in any way so that my tool can work with existing installations on other machines and so on.
I can get ordinary output from programs running inside screen out of the screen session by using a log-file, or by copying the last few lines into the exchange-buffer. What I really need in order to make a nice user interface though is the contents of the status line (the line that temporarily appears at the bottom of the window). For example, to get the list of windows in a session I can send the windowlist command, but the result is never part of the output. Does anyone know if there is a way to make screen put its messages into the log, into a paste-buffer, into the current window, or anything similar where I can grab it from another program?

Controlling USB keyboard and mouse

We have a hardware device, with an LCD display. It supports an USB interface to connect keyboard and mose. Using these keyboard and mouse, we can navigate to varios menu items and edit entries.
We have couple of test cases written to verify that mouse click and keyboard input events are working when pressed respective key.
My task is to automate these test cases.
I donot have any control to the hardware device, as I can not access the o/s kernel or any application running there. There is one way to verify what is currently displayed on the UI. So I have to use that and verify whether the mouse/keyboard has performed the appropriate events.
As I have gone through couple of previous posts, it seems like that one of the way to achieve this is through virual HID device driver rather than actual keyboard and mosue. But I am not sure how to achieve it.
Please do help me for it. I am fine with any programming language.
I am more interested to simulate the mouse and keyboard events.
You probably don't need to write your own driver. AutoHotKey does pretty much anything you can think of, and the scripting language is quite easy to learn.
You can get it here:
http://www.autohotkey.com/
Since you're using linux, here's a similar project that will run on linux:
http://sikuli.org/