TCP spout/syphon to Raspberry PI over LAN

I am trying to figure out how to send video texture data over a local network.

I am using Raspberry PI’s on the recieving end. (so NDI doesnt work on pi’s and neither does touchdesigner touchIn TOP)
However raspberry pi will run a syphon client really well.
techlife.sg/TCPSClient/

I can get this to work on a mac like so:
[Syphon/spout out TOP]-----> [TCPSyphon] —network—>[ Raspberry PI]

each PI is able to specify an IP and Port to listen on the client end.

On a mac I can use TCPSyphon and specify the port number needed for each raspberry pi.


I have 4 raspi’s
[on a mac in touchdesigner:]
I have four different Syphon/spout out TOP’s
I made four TCPSyphon instances and each sends over the network on a different Port number
each of the four raspberry pi’s will listen to only one port number.
This works!

On a windows computer however, TCPSpout does not let you specify a port number.
TCPSpout will make a random port on boot.
I can only set specific ports on a mac so I can only make it work so far on a mac.
Using TCPSpout means I would need to update the raspberry pi listen port on each PI every time I start TCPSpout.


Does anyone know any other way to send video to a raspberry pi from windows? (also allowing for port numbers to be specified on both ends)

OR

Is there a good way to get TCP Spout/Syphon from touchdesigner over the network without using another application in-between?

OR

Does anyone know of another technique to send spout/syphon messages over a network from windows?

OR

Does anyone know if NDI or TouchOut TOP (or any other way) can be sent to a Raspberry pi for display?

Thanks thanks!

it appears that the videostreamout TOP uses RTSP and this will probably work with the PI

Does anyone know an RTSP library for raspi that plays nice with Touchdesigner?

Also very curious about this. No suggestions (yet) Ill see if i can muck around with it over the weekend.

I was able to get video to a pi using the videostreamout top with omxplayer player on a pi.

this seems to work ok except for the 2-3 second delay on the video feed. I hope this is consistent between devices.

the issue now is that touch can only seem to make two videostreamout tops before failing out.

The top has this error:

"Failed to create hardware encoder, error: NVENC indicates that the api call failed because it was unable to allocate enough memory to perform the requested operation.

I am running a GTX1080,
my memory useage is 30%
my GPU memory is 830mb(touchD is only 110) / 8gb

I tried running them all at the same port and also different names and ports with no difference.

The delay comes mostly from the buffer on the receivers. There might be a setting to reduce the buffer size in omxplayer. On the td side everything is quick and hardware accelerated. Which is likely the reason for your other issue. Nvidia only allows two hardware encoded stream on consumer cards

Ya, you’ll need a Quadro to do more stream outs.

I couldn’t find a workable version of TCPSyphon. The page says its been discontinued. Consulted that wayback machine and found this link

web.archive.org/web/20180824144 … Syphon.zip

So,

You might be able to use a cheapo stick computer and NDI monitor. Its a bit more expensive, but would probably work better.

newtek.com/blog/tips/using- … nitor-101/

asus.com/us/Stick-PCs/VivoStick-PC-TS10/

amazon.com/dp/B01AZC4NHS/re … B00XPVRR5M

hmmmm

this is frustrating because it is definitely a working solution with TCPSyphon on a mac + touchdesigner.

The refresh rate was within 2 frames and over gigabit ethernet LAN on a PI model B+ I was able to pipe out 4 different streams to 4 different PI’s in full HD res without an issue.

Being discontinued software, it seems like i have little choice in continuing that route.
I really like the update rates of Syphon/spout over TCP.

Would it be possible to support TCPSyphon protocol within Touchdesigner?
It seems like a protocol that is still being used, even if not by the original devs.

Would anyone be interested in making an updated version of TCPSpout, that can have multiple outputs?

this guy made his own transmitter, but is in Java and seems klunky

doktor-andy.de/wordpress/?p=1917

I am definitely curious about NDI, though I have already bought a bunch of raspberry PI’s for this task and have had real success making it work on a mac platform. My show system is running on windows…

Did you ever figure this out??

nope, I was thinking about diving deeper into making my own TOP that can send the video over the network using TCPSpout protocol.

just need some time and some better coding skills.

plus.google.com/116661941929943910283

any updates on this? been playing with TCPspout on windows and ran into this issue

Ok, I found one workaround that I feel good about.

The server sends a “bonjour” packet on the network that includes whatever random port number it chose on startup.
If you can pickup on this message, you will know the info needed to start the instance on the raspberry pi.

I wrote a little script that picks up on the messages send by the TCPvp

from zeroconf import ServiceBrowser, Zeroconf
import time
import json
serverList = []
class MyListener:
    def remove_service(self, zeroconf, type, name):
        print("Service %s removed" % (name,))
    def add_service(self, zeroconf, type, name):
        info = zeroconf.get_service_info(type, name)
        serverList.append({'name':info.server, 'port':info.port})

zeroconf = Zeroconf()
listener = MyListener()
browser = ServiceBrowser(zeroconf, "_tl_tcpvt._tcp.local.", listener)

time.sleep(1)
zeroconf.close()

print(json.dumps(serverList))

Next, I wrote a script on the PI that will launch the TCP client with whatever port and IP I specity.

works great so far and I can scatter pi’s around my studio to pick up on different streams.
I like this because it keeps the control on my end, It should also find any other TCPSpout or TCPSiphon server on the LAN and be able to route it to any of the pis

1 Like

Hey @drmbt, I think we met in Roger’s Park a couple years back. You were talking about pis then if i remember correctly. Hope all is well!

@harveymoon I think you can also set it in the header or main if I remember correctly. Been a while since I’ve booted the pi’s, but I was able to specify them by name at some point. You can also specify ports with flags. If you’re using SpoutServer, it should tell you what port you’re broadcasting to, so you can set it like ./TCPClient -p 8888 on the pi. You could probably automate that. I’ll have to try the scripting method. I am not sure of a good way to run remote ssh scripts via python in TD but it would be cool to run the client script from your script.

You might also want to check out https://dicaffeine.com/about NDI server/streamer. NDI is supposed to be better for networked video. I think it needs a desktop environment though, as I was unable to get it runnning on an old headless pi. It did not look as good as spout/syphon from what I remember but at least it exists and will hopefully get better. It also has an interface, so its easier to set ports. The license is limited but I think you can do one receiver no problem. Hope this helps someone.

Hey Bjensen,

Thanks for the response.

The whole issue was that you can specify the port in the mac version of TCPServer but not the windows version. It makes a random port on boot.

I already knew you need to set the port on the PI end, but because the windows TCP Server would make a new random port each time. It was stupid annoying to set up 4 pi’s each time then log into each to set their ports to connect to the server.

SO I wrote the script above to find the random port numbers and then wrote a script on the PI so that I can message the PI the new port number as TCP builds one. This has been working fantastic it’s all working and Im happy to share the PI script to launch the TCPClient with the port like you suggested.

The reason I went down this sad path a few years ago was that NDI had no PI support at that time.
I tried a number of different streaming modes on the PI and this was the most robust and cheapest for multiple HD outputs with low latency.

I always wished something would come out NDI<->PI and this dicaffeine looks like it solves all the problems. Ill have to try it out, thanks!

Can confirm dicaffiene works great. You need a rpi4, and you’ll need to account for delay. At 1080 it might drop frames and will be maybe a second behind. For my project I’ve been dropping the res to 1280 and the dropped frames are almost non existent or at least not pi bound, and delay is very small.

Ive had them running for weeks now, so far pretty reliable. Awesome web interface for configuring it.

Highly recommend!