# Streaming over a local network

**URL:** <https://discourse.libcinder.org/t/streaming-over-a-local-network/654>\
**Category:** Using Cinder\
**Created:** [April 11, 2017, 9:15pm UTC](https://discourse.libcinder.org/t/streaming-over-a-local-network/654 "2017-04-11T21:15:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharkbox](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/sharkbox/32/39_2.png) [@sharkbox](https://discourse.libcinder.org/u/sharkbox)\
**Post date:** [April 11, 2017, 9:15pm UTC](https://discourse.libcinder.org/t/streaming-over-a-local-network/654/1 "2017-04-11T21:15:02Z")

</div>

Hey all. I’m trying to stream video over a local switch. I’ve been using Cinder’s ASIO with tcp, and basically doing what @eight_io is doing with this block [https://github.com/eighteight/Cinder-VideoStream](https://github.com/eighteight/Cinder-VideoStream). It’s basically dumping a Surface into a Queue, and sending it off in a thread. Even with a 640x480 8 bit Surface, I’m getting a lot of tearing. The fidelity is important, so I’m trying not to compress it in a lossy way, but I’d also love it to be as close to real-time as possible.

Has anyone has success with such a setup, or any advice to get the most out of asio?

Thanks!  
charlie

---

<div class="post-metadata">

**Author:** ![eight\_io](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/eight_io/32/57_2.png) [@eight\_io](https://discourse.libcinder.org/u/eight_io)\
**Post date:** [April 11, 2017, 10:05pm UTC](https://discourse.libcinder.org/t/streaming-over-a-local-network/654/2 "2017-04-11T22:05:08Z")

</div>

What is the speed of your network? For uncompressed stream at 30 fps 640x480x8x30fps = 73728000 bps ~ 73 mbps. Did you try to compress it (as in my block), to see if at lower data rates the tearing goes down (that would suggest that the network speed may be a factor)?

Another alternative is an NDI protocol [https://www.newtek.com/ndi/](https://www.newtek.com/ndi/) , which provides an SDK, but I don’t know of any cinder blocks for NDI.

–8

---

<div class="post-metadata">

**Author:** ![sharkbox](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/sharkbox/32/39_2.png) [@sharkbox](https://discourse.libcinder.org/u/sharkbox)\
**Post date:** [April 11, 2017, 10:21pm UTC](https://discourse.libcinder.org/t/streaming-over-a-local-network/654/3 "2017-04-11T22:21:59Z")

</div>

I’ve got a gigabit switch. I tried compressing with your block, and while it works fine on osx, for whatever reason it gets scrambled on windows. It must not be sending through the same number of bytes when you compress it, so when it comes through on the receiving end, it’s all interlaced looking.

NDI looks cool, though potentially a bit tricky to set up. I also briefly looked at libx264, but i’m not sure it’s it’s applicable here.

-c

---

<div class="post-metadata">

**Author:** ![sharkbox](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/sharkbox/32/39_2.png) [@sharkbox](https://discourse.libcinder.org/u/sharkbox)\
**Post date:** [April 11, 2017, 10:37pm UTC](https://discourse.libcinder.org/t/streaming-over-a-local-network/654/4 "2017-04-11T22:37:40Z")

</div>

It actually appears there exist both NDI-\>Spout, and NDI-\>Syphon apps. I’m going to test these out before embarking on the block writing.  
-c

[http://spout.zeal.co/download-software/](http://spout.zeal.co/download-software/)

---

<div class="post-metadata">

**Author:** ![hperigo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/hperigo/32/409_2.png) [@hperigo](https://discourse.libcinder.org/u/hperigo)\
**Post date:** [April 11, 2017, 10:41pm UTC](https://discourse.libcinder.org/t/streaming-over-a-local-network/654/5 "2017-04-11T22:41:06Z")

</div>

I think there is a NDI block over here, not sure if it’s working:

> [@\[WIP\]Cinder-NDI](http://discourse.libcinder.org/t/wip-cinder-ndi/322):
>
> Hey all, wanted to share some recent work that I did to bring [Newtek’s NDI protocol](http://www.newtek.com/ndi) into a first version of a Cinder block. You can read all about NDI but in short its a highly efficient video-over-IP protocol that aims LAN’s. The code is pretty minimal to get it up an running and the samples illustrate the sender-receiver concept. I made a short video where some of Cinder’s examples have been pumped with NDI capabilities and are streaming their pixels to showcase the idea ( the sender is runni…

---

<div class="post-metadata">

**Author:** ![petros](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/petros/32/26_2.png) [@petros](https://discourse.libcinder.org/u/petros)\
**Post date:** [April 12, 2017, 1:06pm UTC](https://discourse.libcinder.org/t/streaming-over-a-local-network/654/6 "2017-04-12T13:06:23Z")

</div>

I think NDI would be a great candidate to try out if you have a gigabit connection available. The SDK has been updated in the mean time and I haven’t found the time / need to update the block but I believe @num3ric has kept it updated in [his fork](https://github.com/num3ric/Cinder-NDI) . Plus he has a `cinderblock.xml` file with support for Windows which as I understand is your development platform.

Cheers,  
Petros
