vMix Forums
»
General
»
General Discussion
»
Are TCP/API Responses Correct?
Rank: Advanced Member
Groups: Registered
Joined: 7/10/2020(UTC) Posts: 34 Thanks: 12 times Was thanked: 4 time(s) in 3 post(s)
|
I am wondering if vMix works at its designed on TCP/API Based on example in documentation this command Code:FUNCTION PreviewInput Input=5\r\n
sould give the response Code:FUNCTION OK PreviewInput\r\n
Instead of that it gives this The problem is that if we give a lot of commands we don't know when they executed and if executed normally, because it's imposible to monitor the responses. For example I send the command Code:FUNCTION SnapshotInput Value=snapshot.png Input=1
it takes about 1-2sec to executed. If I get only the "OK Completed" response I don't know if the snapshot completed (to proceed to further actions on my code) or if the response was from another function that runs simultaneous. Is this working as it designed? By the way, is it possible to make it to return the image as Buffer instead saving the snapshot into a file. Thank you
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/13/2010(UTC) Posts: 5,207 Location: Gold Coast, Australia Was thanked: 4285 time(s) in 1519 post(s)
|
Hi,
Only one command should be run at a time. The only exceptions to this are TALLY and ACTS responses which may be received at any time, but these have different responses to FUNCTION so shouldn't cause any conflicts.
The part of the response to look for is FUNCTION OK, the text after it is informational only, such as more information on the error in the case of FUNCTION ER
Regards,
Martin vMix
|
1 user thanked admin for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 7/10/2020(UTC) Posts: 34 Thanks: 12 times Was thanked: 4 time(s) in 3 post(s)
|
Thank's, the response "FUNCTION OK PreviewInput\r\n" as it written on your documentation confused me when I notice that. Acts return preview function in a different format "ACTS OK InputPreview 1 1".
In my code I detect last command (with a queue) to emit an event if a specific function executed and needs further actions. But I thought that a solution like "FUNCTION OK PreviewInput\r\n" etc. will make my code simpler.
Thank you again.
P.S. I know that is difficult, did you think if it’s possible to add a function that return snapshot as image buffer? I use sharp on nodejs to read local file and edit/crop this snapshot, and with this I will avoid the use of tmp file. [please... ;)]
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 7/10/2020(UTC) Posts: 34 Thanks: 12 times Was thanked: 4 time(s) in 3 post(s)
|
I think, after all, to avoid any misunderstanding, Function description on documentationQuote:Commands
FUNCTION Format: FUNCTION <Function> [QueryString]\r\n Example Request: FUNCTION PreviewInput Input=5\r\n Example Request: FUNCTION SetText Input=3&SelectedName=Headline&Value=Hello world\r\n Example Response: FUNCTION OK PreviewInput\r\n Example Response: FUNCTION ER Error message\r\n need to replace "Response: FUNCTION OK PreviewInput" with "Response: FUNCTION OK Completed" as it never gives this type of response.
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
Are TCP/API Responses Correct?
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.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close