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
tsioukas  
#1 Posted : Monday, April 29, 2024 5:36:19 AM(UTC)
tsioukas

Rank: Advanced Member

Groups: Registered
Joined: 7/10/2020(UTC)
Posts: 34
Man
Greece

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
Code:
FUNCTION OK Completed

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
admin  
#2 Posted : Monday, April 29, 2024 6:48:07 PM(UTC)
admin

Rank: Administration

Groups: Administrators
Joined: 1/13/2010(UTC)
Posts: 5,208
Man
Location: Gold Coast, Australia

Was thanked: 4286 time(s) in 1520 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
thanks 1 user thanked admin for this useful post.
tsioukas on 4/29/2024(UTC)
tsioukas  
#3 Posted : Monday, April 29, 2024 7:45:46 PM(UTC)
tsioukas

Rank: Advanced Member

Groups: Registered
Joined: 7/10/2020(UTC)
Posts: 34
Man
Greece

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... ;)]
tsioukas  
#4 Posted : Thursday, May 2, 2024 7:10:49 PM(UTC)
tsioukas

Rank: Advanced Member

Groups: Registered
Joined: 7/10/2020(UTC)
Posts: 34
Man
Greece

Thanks: 12 times
Was thanked: 4 time(s) in 3 post(s)
I think, after all, to avoid any misunderstanding, Function description on documentation
Quote:
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.
Users browsing this topic
Guest
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.