vMix Forums
»
General
»
General Discussion
»
Questions concerning the TCP API
Rank: Advanced Member
Groups: Registered
Joined: 4/16/2013(UTC) Posts: 406  Location: Iowa Thanks: 280 times Was thanked: 32 time(s) in 29 post(s)
|
So I've used the Web API, but was unaware of the TCP API until this week. I'm attempting to use it, but am confused! What are you sending the commands with? A browser? script code? In a browser, all I get is a search response. It's obvious I am misinterpreting the information provided. I had been using Autohotkey to send commands via web commands to vMix, but if the TCP API is more efficient, its obviously the way to go. Just need a little push in the right direction to get started.
Can anyone give me a push?
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/4/2015(UTC) Posts: 17   Thanks: 3 times Was thanked: 7 time(s) in 4 post(s)
|
First you need to connect to vMix using TCP protocol. Then transmit the command in UTF-8 format. Also check the answer from the sent command success or error.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 4/16/2013(UTC) Posts: 406  Location: Iowa Thanks: 280 times Was thanked: 32 time(s) in 29 post(s)
|
So what are you using to transmit/connect?
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/4/2015(UTC) Posts: 17   Thanks: 3 times Was thanked: 7 time(s) in 4 post(s)
|
TCP connection example
client.Connect("127.0.0.1", 8099); NetworkStream stream = client.GetStream(); Byte[] readingData = new Byte[1024]; String responseData = String.Empty; StringBuilder completeMessage = new StringBuilder(); int numberOfBytesRead = 0; do { numberOfBytesRead = stream.Read(readingData, 0, readingData.Length); completeMessage.AppendFormat("Answer: {0}", Encoding.UTF8.GetString(readingData, 0, numberOfBytesRead)); } while (stream.DataAvailable); responseData = completeMessage.ToString(); textBox1.Text = responseData;
Example of TCP transfer vMix command
textBox1.Text = ""; Byte[] data = Encoding.UTF8.GetBytes("FUNCTION OverlayInput1Out\r\n"); NetworkStream stream = client.GetStream(); stream.Write(data, 0, data.Length); Byte[] readingData = new Byte[1024]; String responseData = String.Empty; StringBuilder completeMessage = new StringBuilder(); int numberOfBytesRead = 0; do { numberOfBytesRead = stream.Read(readingData, 0, readingData.Length); completeMessage.AppendFormat("Answer: {0}", Encoding.UTF8.GetString(readingData, 0, numberOfBytesRead)); } while (stream.DataAvailable); responseData = completeMessage.ToString(); textBox1.Text = responseData;
|
 2 users thanked Stealth77 for this useful post.
|
|
|
vMix Forums
»
General
»
General Discussion
»
Questions concerning the TCP API
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