logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
jeffmikels  
#1 Posted : Friday, January 15, 2021 3:21:41 AM(UTC)
jeffmikels

Rank: Newbie

Groups: Registered
Joined: 1/15/2021(UTC)
Posts: 5
United States
Location: LAFAYETTE

Please add a Shortcut to vMix to get a preview image from an Input through the API.

See further explanation and suggestions below:

https://forums.vmix.com/...nails-over-API#post87673
doggy  
#2 Posted : Friday, January 15, 2021 3:49:16 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,222
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
already there: snapshotinput
jeffmikels  
#3 Posted : Friday, January 15, 2021 5:26:11 AM(UTC)
jeffmikels

Rank: Newbie

Groups: Registered
Joined: 1/15/2021(UTC)
Posts: 5
United States
Location: LAFAYETTE

Doesn't that just save a file on the machine? I want to receive the image data over the API.
doggy  
#4 Posted : Friday, January 15, 2021 12:03:53 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,222
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: jeffmikels Go to Quoted Post
I want to receive the image data over the API.


What do you mean ?

jeffmikels  
#5 Posted : Friday, January 15, 2021 5:03:04 PM(UTC)
jeffmikels

Rank: Newbie

Groups: Registered
Joined: 1/15/2021(UTC)
Posts: 5
United States
Location: LAFAYETTE

The command

FUNCTION SnapshotInputNet Input=1&Format=jpg

Should respond

SnapshotInput OK 123456
(123456 bytes of jpeg data)

Does that make sense?

vMix should take the snapshot, but not save it at all and instead send the image data directly out as the response to the API.
doggy  
#6 Posted : Friday, January 15, 2021 5:45:10 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,222
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: jeffmikels Go to Quoted Post
The command

FUNCTION SnapshotInputNet Input=1&Format=jpg

Should respond

SnapshotInput OK 123456
(123456 bytes of jpeg data)

Does that make sense?

vMix should take the snapshot, but not save it at all and instead send the image data directly out as the response to the API.


Why would it have to respond as the response is the saved image (snapshot) . the point of this function is to actually save a snapshot of the input specified (instead of the general output snapshot)

btw the function is written completely wrong

Function=SnapshotInput&Input=nameofinput&Value=filename.png (doesn't seem to respond to the input number)
or
API.Function("SnapshotInput",Input:="nameofinput",Value:="filename.png")

from the helpfiles:
SnapshotInput - Create a snapshot image of the selected Input. Optional Value specifies save Filename, otherwise a save file window will appear. Filename can specify date, for example mysnapshot {0:dd MMM yyyy}.jpg


Might help if you stated your actual goal with a snapshot
jeffmikels  
#7 Posted : Friday, January 15, 2021 11:56:39 PM(UTC)
jeffmikels

Rank: Newbie

Groups: Registered
Joined: 1/15/2021(UTC)
Posts: 5
United States
Location: LAFAYETTE

I wrote my command using the TCP syntax.

The point is to get an image of an input to a different computer on the network. The API methods allow all kinds of information to be accessed over the network, but preview images are an exception. Since vMix can TAKE snapshots using the API, it should also be able to SEND snapshots.
doggy  
#8 Posted : Saturday, January 16, 2021 1:58:00 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,222
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: jeffmikels Go to Quoted Post
I wrote my command using the TCP syntax.



IC

Quote:


The point is to get an image of an input to a different computer on the network. The API methods allow all kinds of information to be accessed over the network, but preview images are an exception. Since vMix can TAKE snapshots using the API, it should also be able to SEND snapshots.


Exception and Should it ? that's bold

What about using a standard copy command in a vMix script ?
We send recordings and snapshots that way all the time

Btw you want to transfer a image file not its data(name,size,format etc), would have understood the goal quicker, sorry
That's not the same as retrieving information
jeffmikels  
#9 Posted : Saturday, January 16, 2021 5:44:49 AM(UTC)
jeffmikels

Rank: Newbie

Groups: Registered
Joined: 1/15/2021(UTC)
Posts: 5
United States
Location: LAFAYETTE

Originally Posted by: doggy Go to Quoted Post
What about using a standard copy command in a vMix script ?
We send recordings and snapshots that way all the time


I already have workarounds for what I need, but I think this feature should not need a workaround.

Here are all the details I can think of for this feature request:

I'm writing an app to employ all the features of the vMix API as a simple "Remote Control" for vMix.

Having an image for each one of the inputs would make my app more usable.

Currently, I use the API to tell vMix to snapshot an input and save it to a file like so:

Code:
?Function=SnapshotInput&Input=1&Value=1.jpg


That saves the image as 1.jpg to the vmixStorage directory on the computer.

I'm also running a nodejs server on the same computer to serve those image files back to me so my app can get the snapshot images.

This workaround works, and I have also implemented a different workaround that gets snapshot images directly from the NDI feeds.

However, both of these methods are slow, and with such an incredibly robust API, vmix could easily accomplish this directly without any workarounds.


To be specific: what I want is to be able to send something like this API request:

Code:
?Function=SnapshotInputImage&Input=1&Value=640x320,jpg


and have the response be the immediately generated jpg image at the specified resolution

or using the TCP API, something like this:

Code:
FUNCTION SNAPSHOTINPUTIMAGE Input=1&Value=1920x1080,png


and have the following be the response

Code:
SNAPSHOTINPUTIMAGE OK 123456
(123456 bytes of png data)



I labelled the original post as "Easy" because I think my request requires no new features. Instead of writing the bytes to disk, this new api shortcut/function would stream the bytes directly over the TCP connection or as the body of the HTTP response.

If I had access to the source code. I'm sure I could implement it myself in about 5 minutes, but the current developers could do it I'm sure in less than 1.
doggy  
#10 Posted : Saturday, January 16, 2021 6:01:33 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,222
Belgium
Location: Belgium

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Much better explanation than originally posted :-)
AdamMiner  
#11 Posted : Thursday, January 28, 2021 11:27:08 AM(UTC)
AdamMiner

Rank: Member

Groups: Registered
Joined: 8/1/2019(UTC)
Posts: 14
United States
Location: Kansas

Originally Posted by: jeffmikels Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
What about using a standard copy command in a vMix script ?
We send recordings and snapshots that way all the time


I already have workarounds for what I need, but I think this feature should not need a workaround.

Here are all the details I can think of for this feature request:

I'm writing an app to employ all the features of the vMix API as a simple "Remote Control" for vMix.

Having an image for each one of the inputs would make my app more usable.

Currently, I use the API to tell vMix to snapshot an input and save it to a file like so:

Code:
?Function=SnapshotInput&Input=1&Value=1.jpg


That saves the image as 1.jpg to the vmixStorage directory on the computer.

I'm also running a nodejs server on the same computer to serve those image files back to me so my app can get the snapshot images.

This workaround works, and I have also implemented a different workaround that gets snapshot images directly from the NDI feeds.

However, both of these methods are slow, and with such an incredibly robust API, vmix could easily accomplish this directly without any workarounds.


To be specific: what I want is to be able to send something like this API request:

Code:
?Function=SnapshotInputImage&Input=1&Value=640x320,jpg


and have the response be the immediately generated jpg image at the specified resolution

or using the TCP API, something like this:

Code:
FUNCTION SNAPSHOTINPUTIMAGE Input=1&Value=1920x1080,png


and have the following be the response

Code:
SNAPSHOTINPUTIMAGE OK 123456
(123456 bytes of png data)



I labelled the original post as "Easy" because I think my request requires no new features. Instead of writing the bytes to disk, this new api shortcut/function would stream the bytes directly over the TCP connection or as the body of the HTTP response.

If I had access to the source code. I'm sure I could implement it myself in about 5 minutes, but the current developers could do it I'm sure in less than 1.


+1

I'm also making a web dashboard for my team, and it's crazy because the normal vMix web Shortcuts page has images, but they don't match the GUID of the input, so you can't just link to those. Also, with the streamdeck showing live preview to each button, I don't think it's a performance limitation, since it's spirtually similar?

Also, the resolution parameter, or something selecting a size that's more reasonable for web than 3840x2160 would be appreciated as well.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.