It is currently 22 Jun 2017, 19:23



Client progress bar

CasparCG Server, Client and development

Moderators: Macey, Jonas Hummelstrand, didikunz

Client progress bar

Postby ASmith3006 » 24 Apr 2017, 18:01

Hi,

Can anyone give me a high-level overview of how the client gets the "progress bar" to work? I'm seeing the following behaviour:
  • Select a video in client
  • Play with loop
  • Green progress bar appears
  • Close client (don't save)
  • Reload client
  • Put same video onto rundown
  • Progress bar appears instantly
  • Console output on server doesn't show any connections
I'm writing my own client and showing the progress bar is an important feature. Originally I thought I would have to poll constantly for the current frame position, but the client appears to be doing this in a much more efficient manner. I don't believe it's the OSC as this isn't configured on my server.

Any pointers would be greatly appreciated.

Thanks.
ASmith3006
 
Posts: 66
Joined: 12 Dec 2013, 14:47

Re: Client progress bar

Postby didikunz » 24 Apr 2017, 18:20

AFAIK it is actually OSC. As a udp protocoll you configure it on the client. There is also the INFO command where you can poll for the information. But OSC is much more elegant.
Didi Kunz
CasparCG Client-Programmer, Template Maker & Live CG-Operator
Media Support, CH-5722 Gränichen, Switzerland http://mediasupport.ch/
Problems? Guide to posting Bug reports & Feature requests
User avatar
didikunz
 
Posts: 3477
Joined: 10 May 2010, 09:08
Location: Aarau, Switzerland

Re: Client progress bar

Postby ASmith3006 » 25 Apr 2017, 14:13

Didi,

Thanks for that. I thought it was that but then was thrown off by the fact that my server .config file doesn't have OSC enabled in there.

Can you only have one UDP OSC connection at any one time? It seems if I connect using a custom app that the progress in the CasparCG Client goes blank?
ASmith3006
 
Posts: 66
Joined: 12 Dec 2013, 14:47

Re: Client progress bar

Postby balte » 27 Apr 2017, 10:51

All previously mentioned observations are correct behavior and are a consequence of CasparCG Server being an OSC client. For more information on this you should resort to the wiki!

To quickly explain what you are seeing:

CasparCG Server starts an OSC session against the IP with which it has established an AMCP connection. Thus, no additional configuration is required.

Because a CasparCG Client is the OSC server, you can only have one client receiving OSC on a single port. If you want two clients on the same ip address to receive OSC, you will have to manually configure CasparCG Server to send OSC messages to an OSC Server on a non-default port.
CasparCG enthusiast and broadcast geek - Sometimes, I do get payed for this stuff.
User avatar
balte
 
Posts: 264
Joined: 24 Jan 2015, 16:23
Location: The Netherlands, Goeree Overflakkee

Re: Client progress bar

Postby Skyflyer » 28 Apr 2017, 10:18

If you are using VB.NET or C# you can use a property in the UdpClient class that lets several programs on the same computer listen to the same UDP port.
Something like this:
C#:
Code: Select all
IPEndPoint localpt = new IPEndPoint(IPAddress.Any, 6000);
UdpClient udpServer2 = new UdpClient();
udpServer2.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
udpServer2.Client.Bind(localpt);

VB.NET:
Code: Select all
Dim udpListener New UdpClient()
udpListener .ExclusiveAddressUse = False
udpListener .Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, True)
Dim LocalIpEndPoint As New System.Net.IPEndPoint(System.Net.IPAddress.Any, 0)
udpListener.Client.Bind(LocalIpEndPoint)

I don't recall if both programs has to use code similar to the example above or if it works if only one program do it.

I think it works like this if only one program has the ReuseAddress code: Your program with the ReuseAddress must listen to the udp port first, before the other program starts listening on the port. If another program starts to listen to the UDP port without doing something like the code above then you will not be able to open the port in your program even if you use the above code.

I only knows how to do it in .NET. I guess other program languages may have something similar depending on the language. You can read more about it here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms740621(v=vs.85).aspx

Disclaimer: I have not used this to receive OSC data but I have used this technique in other applications where you have one program sending out data on a port and another program is receiving the data on the same port on the same computer.
Skyflyer
 
Posts: 2
Joined: 11 Feb 2013, 19:12

Re: Client progress bar

Postby ASmith3006 » 15 May 2017, 13:12

Thank you all, extremely helpful.

Followup question here:

Does this work across different subnets? I can connect from my client to the server and control it, but I'm not getting the OSC commands back.

Edit: My mistake. It does work across subnets. I was setting the IP address to be the remote address rather than the local listening address. This worked when I was running caspar locally as the "local" and "remote" addresses were the same.
ASmith3006
 
Posts: 66
Joined: 12 Dec 2013, 14:47


Return to Tech and Development

Who is online

Users browsing this forum: No registered users and 7 guests