diff --git a/README.md b/README.md index 674d75e..f1224a5 100644 --- a/README.md +++ b/README.md @@ -4,51 +4,31 @@ vMix has a robust API, but one key limitation of the API is that while you can tell vMix to take a snapshot of an input, it will save the image on the vMix machine but not send the image over the network. -This is a small application running on the nodejs framework to act as a proxy -for those images. +The Snapshot Proxy is a small application written in the Go language to automatically generate +those images and provide them over the network to other applications. The application is especially helpful in providing preview images of each input for [Unofficial vMix Remote Control for Android](https://play.google.com/store/apps/details?id=org.jeffmikels.vmix_remote) [Unofficial vMix Remote Control for iOS](https://apps.apple.com/us/app/unofficial-vmix-remote-control/id1551404035) -## Installation for Advanced Users +## Installation: -These commands should be run on the same computer that is running vMix. +- Download the latest zip file from the [Releases Page](https://github.com/jeffmikels/vmix-snapshot-proxy/releases) +- Unzip the file. +- Put the `.exe` and the `.bat` files both in the same directory wherever you want (NOTE: they must be on the SAME computer that's running vMix). +- Start vMix. +- Double-click on the `.bat` file. +- If you have problems, look at the `.bat` file for the available command line options: + - `-h` will print the help + - `-p` will allow you to specify the Web API port vMix is using + - `-d` will allow you to specify the directory where vMix stores snapshot images -```bash -$ git clone https://github.com/jeffmikels/vmix-snapshot-proxy.git -$ cd vmix-snapshot-proxy -$ npm install -``` +## Advanced Usage: -## Usage +When running, the proxy will open a web server at port `8098` and will expose the following HTTP endpoints: -Edit the settings at the top of `index.js`. - -Start vMix and then the proxy server... - -``` -$ node index.js -``` - -You'll see something like the following output - -``` -===================================== -Running vMix Snapshot Proxy at port 8098 -Get a list of all inputs: http://192.168.1.1:8098/ -Force regen one input (0 means program): http://192.168.1.1:8098/regen/# -Force regen all inputs: http://192.168.1.1:8098/regen -Get input snapshot: http://192.168.1.1:8098/#.jpg - -Getting an input snapshot sends the most recent snapshot, and queues the generation of a new one. -Snapshots take about 1 second to process -===================================== -``` - -Open a browser and visit: - -`http://[PROXY_IP_ADDRESS]:8098/[INPUT_NUMBER].jpg` - -Every time you visit that address, you will receive a new snapshot image of the selected input. +- `http://[IP_ADDRESS]:8098/` will return a list of all the discovered vMix inputs +- `http://[IP_ADDRESS]:8098/regen` will trigger a global regeneration of all input snapshots +- `http://[IP_ADDRESS]:8098/regen/[INPUT_NUMBER]` will trigger a regeneration of one input's snapshot +- `http://[IP_ADDRESS]:8098/[INPUT_NUMBER].jpg` will serve the input snapshot as a jpg image. diff --git a/build-win.sh b/build-win.sh deleted file mode 100755 index d43634e..0000000 --- a/build-win.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# this process assembles the electron app manually -# assuming the binary has already been downloaded into the release directory - -TARGET=release/vmix-snapshot-proxy/resources/app -if [[ ! -d $TARGET ]]; then mkdir "$TARGET"; fi -rm -rf $TARGET/* -mkdir "$TARGET/lib" - -install() { - cp "$1" "$TARGET/$1" -} - -install package.json -install main.js -install preload.js -install renderer.js -install index.html -install lib/vue.js - -# install node_modules -pushd "$TARGET" -npm i --production -popd diff --git a/go-version/build.sh b/go-version/build.sh index b20f035..98b881f 100755 --- a/go-version/build.sh +++ b/go-version/build.sh @@ -1,3 +1,6 @@ #!/bin/bash +go mod tidy env GOOS=windows GOARCH=amd64 go build -o vmix-snapshot-proxy.exe + +zip -u vmix-snapshot-proxy.zip vmix-snapshot-proxy.exe vmix-snapshot-proxy.bat diff --git a/go-version/vmix-snapshot-proxy.exe b/go-version/vmix-snapshot-proxy.exe index e4e1f21..bcc184b 100755 Binary files a/go-version/vmix-snapshot-proxy.exe and b/go-version/vmix-snapshot-proxy.exe differ diff --git a/go-version/vmix-snapshot-proxy.go b/go-version/vmix-snapshot-proxy.go index 0d30f17..2a3442e 100644 --- a/go-version/vmix-snapshot-proxy.go +++ b/go-version/vmix-snapshot-proxy.go @@ -52,7 +52,7 @@ type Inputs struct { Inputs []Input `xml:"input"` } -//Input{name: "Camera 1", number: 1} +// Input{name: "Camera 1", number: 1} type Input struct { XMLName xml.Name `xml:"input"` Name string `xml:"title,attr"` @@ -196,6 +196,8 @@ func main() { } }() + PrintStatus() + // start the server app.Listen(fmt.Sprintf("%s:%d", myIp, proxyPort)) diff --git a/go-version/vmix-snapshot-proxy.zip b/go-version/vmix-snapshot-proxy.zip index 66a4086..fc91f0c 100644 Binary files a/go-version/vmix-snapshot-proxy.zip and b/go-version/vmix-snapshot-proxy.zip differ diff --git a/index.html b/index.html deleted file mode 100644 index b60841e..0000000 --- a/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - -
- - - - - - -{{msg}}-
{{output}}-
loading inputs...
-