# Video stream plays only seconds and then stop

**URL:** https://discourse.lynckia.com/t/video-stream-plays-only-seconds-and-then-stop/223
**Category:** Uncategorized
**Created:** [November 21, 2013, 4:10am UTC](https://discourse.lynckia.com/t/video-stream-plays-only-seconds-and-then-stop/223 "2013-11-21T04:10:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Yunfan\_Jiang](https://avatars.discourse-cdn.com/v4/letter/y/51bf81/32.png) [@Yunfan\_Jiang](https://discourse.lynckia.com/u/Yunfan_Jiang)
#### Post date: [November 21, 2013, 4:10am UTC](https://discourse.lynckia.com/t/video-stream-plays-only-seconds-and-then-stop/223/1 "2013-11-21T04:10:05Z")

</div>

Hi, i am using licode for building a broadcasting service, the basic  
concepts is that in a room, there would be two role type: presenter and  
viewer

presenter could publish stream while viewer only subscribed them

i modify the basic\_example to let user choose their role manually

and i met a problem.

Problem:  
1, i found that 3 clients in my local network works well if the licode  
hosting is also in the local network  
2, if i host licode in a public vps, and invite my friend for testing the  
service, he as a presenter has a camara, could send stream to me (as the  
viewer)  
but the video play on myside only insists for seconds, and then it  
shows black screen.  
3, i am now on my office(behind another router), and i could subscribe  
his stream and play that for long times

My guess:

i knew webrtc’s p2p communication need to do udp hole punching, and from  
the effects of above step 2, it successed. but some nat

seems would disable the punching if his inner client dont send data through  
that port, in my case, as a viewer role, my browser wont sent

data throught that port except the begining connecting steps, that  
explained why myside could receive the stream at the begining and after a

while, it stop, just because it wont sent data back after connected, so the  
router would disable that port

the above is all my guess, i dont know if it’s the true, if that, i  
think maybe you guys need consider send heartbeat packages between peers

for consist the connection

BTW, can anyone tell me how many events there? i cant find any documents  
about that

---

<div class="post-metadata">

### Author: ![Yunfan\_Jiang](https://avatars.discourse-cdn.com/v4/letter/y/51bf81/32.png) [@Yunfan\_Jiang](https://discourse.lynckia.com/u/Yunfan_Jiang)
#### Post date: [November 22, 2013, 3:15am UTC](https://discourse.lynckia.com/t/video-stream-plays-only-seconds-and-then-stop/223/2 "2013-11-22T03:15:07Z")

</div>

hi, its me again, after taking your advice and setup an TURN server

my device at home could now receive the video stream as a viewer role, but  
the problem occured again, after a minute, the video stream would freeze  
and stop playing, it seems like no video frame data has come

here are the logs for my services

and i really need to documents which list all events for room and stream2013/11/21 Yunfan Jiang [jyf1987@gmail.com](mailto:jyf1987@gmail.com)

> Hi, thanks for the replying, i configured licode and add a in-use TURN  
> server
> 
> i invited 5 friend for testing, only 2 of them success while the rest 3  
> guys still got the black screen
> 
> all 5 friends are behind a NAT
> 
> the successful 2, one is behind a company’s NAT while another is behind  
> the home NAT
> 
> 2013/11/21 Ricardo@GMail [pt.n00b@gmail.com](mailto:pt.n00b@gmail.com)
> 
> Hi Alex Smith,
> 
> > You probably need a TURN server to act as relay. Check this article from  
> > HTML5Rocks: [http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/](http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/)
> > 
> > Hope it is helpful.
> > 
> > Sincerely,  
> > _Ricardo Machado_
> > 
> > 2013/11/21 alex smith [jyf1987@gmail.com](mailto:jyf1987@gmail.com)
> > 
> > > Hi, i am using licode for building a broadcasting service, the basic  
> > > concepts is that in a room, there would be two role type: presenter and  
> > > viewer
> > > 
> > > presenter could publish stream while viewer only subscribed them
> > > 
> > > i modify the basic\_example to let user choose their role manually
> > > 
> > > and i met a problem.
> > > 
> > > Problem:  
> > > 1, i found that 3 clients in my local network works well if the licode  
> > > hosting is also in the local network  
> > > 2, if i host licode in a public vps, and invite my friend for testing  
> > > the service, he as a presenter has a camara, could send stream to me (as  
> > > the viewer)  
> > > but the video play on myside only insists for seconds, and then it  
> > > shows black screen.  
> > > 3, i am now on my office(behind another router), and i could subscribe  
> > > his stream and play that for long times
> > > 
> > > My guess:
> > > 
> > > i knew webrtc’s p2p communication need to do udp hole punching, and  
> > > from the effects of above step 2, it successed. but some nat
> > > 
> > > seems would disable the punching if his inner client dont send data  
> > > through that port, in my case, as a viewer role, my browser wont sent
> > > 
> > > data throught that port except the begining connecting steps, that  
> > > explained why myside could receive the stream at the begining and after a
> > > 
> > > while, it stop, just because it wont sent data back after connected, so  
> > > the router would disable that port
> > > 
> > > the above is all my guess, i dont know if it’s the true, if that, i  
> > > think maybe you guys need consider send heartbeat packages between peers
> > > 
> > > for consist the connection
> > > 
> > > BTW, can anyone tell me how many events there? i cant find any documents  
> > > about that
> > > 
> > > –  
> > > You received this message because you are subscribed to the Google  
> > > Groups “lynckia” group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [lynckia+unsubscribe@googlegroups.com](mailto:lynckia+unsubscribe@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > –  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups “lynckia” group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/lynckia/7Etzo2SEBY0/unsubscribe](https://groups.google.com/d/topic/lynckia/7Etzo2SEBY0/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [lynckia+unsubscribe@googlegroups.com](mailto:lynckia+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> –  
> Name: yunfan  
> Location: China/Beijing  
> Site: [http://geek42.info/](http://geek42.info/)  
> IM:
> 
> - gtalk: jyf1987 at gmail dot com
> - irc: [irc.freenode.net/#ubuntu-cn](http://irc.freenode.net/#ubuntu-cn)  
> Interest:
> - Lang: [forth, clojure, c, python, lua]
> - software: [nginx, redis]
> - abstract: [vm, tiny, cloud, html5]
> - history
> - science-fiction
> - music: [new-age, vangelis, yanni]

–  
Name: yunfan  
Location: China/Beijing  
Site: [http://geek42.info/](http://geek42.info/)  
IM:

- gtalk: jyf1987 at gmail dot com
- irc: [irc.freenode.net/#ubuntu-cn](http://irc.freenode.net/#ubuntu-cn)  
Interest:
- Lang: [forth, clojure, c, python, lua]
- software: [nginx, redis]
- abstract: [vm, tiny, cloud, html5]
- history
- science-fiction
- music: [new-age, vangelis, yanni]

[logs.tar.gz](https://discourse.lynckia.com/uploads/lynckia/original/1X/ef8049e755c378793e105b6fc80e2a2a13d0cb3b.gz) (3.23 KB)

---

<div class="post-metadata">

### Author: ![1115](https://avatars.discourse-cdn.com/v4/letter/1/9f8e36/32.png) [@1115](https://discourse.lynckia.com/u/1115)
#### Post date: [November 22, 2013, 1:31pm UTC](https://discourse.lynckia.com/t/video-stream-plays-only-seconds-and-then-stop/223/3 "2013-11-22T13:31:52Z")

</div>

anyone can give a help? i have this problem too.

在 2013年11月22日星期五UTC+8上午11时15分07秒，alex smith写道：\>

> hi, its me again, after taking your advice and setup an TURN server
> 
> my device at home could now receive the video stream as a viewer role, but  
> the problem occured again, after a minute, the video stream would freeze  
> and stop playing, it seems like no video frame data has come
> 
> here are the logs for my services
> 
> and i really need to documents which list all events for room and stream
> 
> 2013/11/21 Yunfan Jiang \<[jyf...@gmail.com](mailto:jyf...@gmail.com) \<javascript:\>\>
> 
> > Hi, thanks for the replying, i configured licode and add a in-use TURN  
> > server
> > 
> > i invited 5 friend for testing, only 2 of them success while the rest 3  
> > guys still got the black screen
> > 
> > all 5 friends are behind a NAT
> > 
> > the successful 2, one is behind a company’s NAT while another is behind  
> > the home NAT
> > 
> > 2013/11/21 Ricardo@GMail \<[pt....@gmail.com](mailto:pt....@gmail.com) \<javascript:\>\>
> > 
> > Hi Alex Smith,
> > 
> > > You probably need a TURN server to act as relay. Check this article from  
> > > HTML5Rocks:  
> > > [http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/](http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/)
> > > 
> > > Hope it is helpful.
> > > 
> > > Sincerely,  
> > > _Ricardo Machado_
> > > 
> > > 2013/11/21 alex smith \<[jyf...@gmail.com](mailto:jyf...@gmail.com) \<javascript:\>\>
> > > 
> > > > Hi, i am using licode for building a broadcasting service, the basic  
> > > > concepts is that in a room, there would be two role type: presenter and  
> > > > viewer
> > > > 
> > > > presenter could publish stream while viewer only subscribed them
> > > > 
> > > > i modify the basic\_example to let user choose their role manually
> > > > 
> > > > and i met a problem.
> > > > 
> > > > Problem:  
> > > > 1, i found that 3 clients in my local network works well if the  
> > > > licode hosting is also in the local network  
> > > > 2, if i host licode in a public vps, and invite my friend for testing  
> > > > the service, he as a presenter has a camara, could send stream to me (as  
> > > > the viewer)  
> > > > but the video play on myside only insists for seconds, and then  
> > > > it shows black screen.  
> > > > 3, i am now on my office(behind another router), and i could  
> > > > subscribe his stream and play that for long times
> > > > 
> > > > My guess:
> > > > 
> > > > i knew webrtc’s p2p communication need to do udp hole punching, and  
> > > > from the effects of above step 2, it successed. but some nat
> > > > 
> > > > seems would disable the punching if his inner client dont send data  
> > > > through that port, in my case, as a viewer role, my browser wont sent
> > > > 
> > > > data throught that port except the begining connecting steps, that  
> > > > explained why myside could receive the stream at the begining and after a
> > > > 
> > > > while, it stop, just because it wont sent data back after connected, so  
> > > > the router would disable that port
> > > > 
> > > > the above is all my guess, i dont know if it’s the true, if that, i  
> > > > think maybe you guys need consider send heartbeat packages between peers
> > > > 
> > > > for consist the connection
> > > > 
> > > > BTW, can anyone tell me how many events there? i cant find any  
> > > > documents about that
> > > > 
> > > > –  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups “lynckia” group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [lynckia+u...@googlegroups.com](mailto:lynckia+u...@googlegroups.com) \<javascript:\>.  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > –  
> > > You received this message because you are subscribed to a topic in the  
> > > Google Groups “lynckia” group.  
> > > To unsubscribe from this topic, visit  
> > > [https://groups.google.com/d/topic/lynckia/7Etzo2SEBY0/unsubscribe](https://groups.google.com/d/topic/lynckia/7Etzo2SEBY0/unsubscribe).  
> > > To unsubscribe from this group and all its topics, send an email to  
> > > [lynckia+u...@googlegroups.com](mailto:lynckia+u...@googlegroups.com) \<javascript:\>.  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > –  
> > Name: yunfan  
> > Location: China/Beijing  
> > Site: [http://geek42.info/](http://geek42.info/)[http://www.google.com/url?q=http%3A%2F%2Fgeek42.info%2F&sa=D&sntz=1&usg=AFQjCNEkm2nXTGmVk5MXw3WStHTuQwyR2w](http://www.google.com/url?q=http%3A%2F%2Fgeek42.info%2F&sa=D&sntz=1&usg=AFQjCNEkm2nXTGmVk5MXw3WStHTuQwyR2w)  
> > IM:
> > 
> > - gtalk: jyf1987 at gmail dot com
> > - irc: [irc.freenode.net/#ubuntu-cn](http://irc.freenode.net/#ubuntu-cn)[http://www.google.com/url?q=http%3A%2F%2Firc.freenode.net%2F%23ubuntu-cn&sa=D&sntz=1&usg=AFQjCNFRDqFWwY\_YltwzgScKiT1KyHoU3w](http://www.google.com/url?q=http%3A%2F%2Firc.freenode.net%2F%23ubuntu-cn&sa=D&sntz=1&usg=AFQjCNFRDqFWwY_YltwzgScKiT1KyHoU3w)  
> > Interest:
> > - Lang: [forth, clojure, c, python, lua]
> > - software: [nginx, redis]
> > - abstract: [vm, tiny, cloud, html5]
> > - history
> > - science-fiction
> > - music: [new-age, vangelis, yanni]
> 
> –  
> Name: yunfan  
> Location: China/Beijing  
> Site: [http://geek42.info/](http://geek42.info/)[http://www.google.com/url?q=http%3A%2F%2Fgeek42.info%2F&sa=D&sntz=1&usg=AFQjCNEkm2nXTGmVk5MXw3WStHTuQwyR2w](http://www.google.com/url?q=http%3A%2F%2Fgeek42.info%2F&sa=D&sntz=1&usg=AFQjCNEkm2nXTGmVk5MXw3WStHTuQwyR2w)  
> IM:
> 
> - gtalk: jyf1987 at gmail dot com
> - irc: [irc.freenode.net/#ubuntu-cn](http://irc.freenode.net/#ubuntu-cn)[http://www.google.com/url?q=http%3A%2F%2Firc.freenode.net%2F%23ubuntu-cn&sa=D&sntz=1&usg=AFQjCNFRDqFWwY\_YltwzgScKiT1KyHoU3w](http://www.google.com/url?q=http%3A%2F%2Firc.freenode.net%2F%23ubuntu-cn&sa=D&sntz=1&usg=AFQjCNFRDqFWwY_YltwzgScKiT1KyHoU3w)  
> Interest:
> - Lang: [forth, clojure, c, python, lua]
> - software: [nginx, redis]
> - abstract: [vm, tiny, cloud, html5]
> - history
> - science-fiction
> - music: [new-age, vangelis, yanni]

---

<div class="post-metadata">

### Author: ![Ricardo](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@Ricardo](https://discourse.lynckia.com/u/Ricardo)
#### Post date: [November 21, 2013, 8:15am UTC](https://discourse.lynckia.com/t/video-stream-plays-only-seconds-and-then-stop/223/4 "2013-11-21T08:15:48Z")

</div>

Hi Alex Smith,

You probably need a TURN server to act as relay. Check this article from  
HTML5Rocks: [WebRTC uygulaması için gereken arka uç hizmetlerini derleme &nbsp;|&nbsp; Articles &nbsp;|&nbsp; web.dev](http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/)

Hope it is helpful.

Sincerely,  
_Ricardo Machado_2013/11/21 alex smith [jyf1987@gmail.com](mailto:jyf1987@gmail.com)

> Hi, i am using licode for building a broadcasting service, the basic  
> concepts is that in a room, there would be two role type: presenter and  
> viewer
> 
> presenter could publish stream while viewer only subscribed them
> 
> i modify the basic\_example to let user choose their role manually
> 
> and i met a problem.
> 
> Problem:  
> 1, i found that 3 clients in my local network works well if the licode  
> hosting is also in the local network  
> 2, if i host licode in a public vps, and invite my friend for testing  
> the service, he as a presenter has a camara, could send stream to me (as  
> the viewer)  
> but the video play on myside only insists for seconds, and then it  
> shows black screen.  
> 3, i am now on my office(behind another router), and i could subscribe  
> his stream and play that for long times
> 
> My guess:
> 
> i knew webrtc’s p2p communication need to do udp hole punching, and from  
> the effects of above step 2, it successed. but some nat
> 
> seems would disable the punching if his inner client dont send data  
> through that port, in my case, as a viewer role, my browser wont sent
> 
> data throught that port except the begining connecting steps, that  
> explained why myside could receive the stream at the begining and after a
> 
> while, it stop, just because it wont sent data back after connected, so  
> the router would disable that port
> 
> the above is all my guess, i dont know if it’s the true, if that, i  
> think maybe you guys need consider send heartbeat packages between peers
> 
> for consist the connection
> 
> BTW, can anyone tell me how many events there? i cant find any documents  
> about that
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “lynckia” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [lynckia+unsubscribe@googlegroups.com](mailto:lynckia+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Yunfan\_Jiang](https://avatars.discourse-cdn.com/v4/letter/y/51bf81/32.png) [@Yunfan\_Jiang](https://discourse.lynckia.com/u/Yunfan_Jiang)
#### Post date: [November 21, 2013, 9:29am UTC](https://discourse.lynckia.com/t/video-stream-plays-only-seconds-and-then-stop/223/5 "2013-11-21T09:29:43Z")

</div>

Hi, thanks for the replying, i configured licode and add a in-use TURN  
server

i invited 5 friend for testing, only 2 of them success while the rest 3  
guys still got the black screen

all 5 friends are behind a NAT

the successful 2, one is behind a company’s NAT while another is behind the  
home NAT2013/11/21 Ricardo@GMail [pt.n00b@gmail.com](mailto:pt.n00b@gmail.com)

> Hi Alex Smith,
> 
> You probably need a TURN server to act as relay. Check this article from  
> HTML5Rocks: [http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/](http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/)
> 
> Hope it is helpful.
> 
> Sincerely,  
> _Ricardo Machado_
> 
> 2013/11/21 alex smith [jyf1987@gmail.com](mailto:jyf1987@gmail.com)
> 
> > Hi, i am using licode for building a broadcasting service, the basic  
> > concepts is that in a room, there would be two role type: presenter and  
> > viewer
> > 
> > presenter could publish stream while viewer only subscribed them
> > 
> > i modify the basic\_example to let user choose their role manually
> > 
> > and i met a problem.
> > 
> > Problem:  
> > 1, i found that 3 clients in my local network works well if the licode  
> > hosting is also in the local network  
> > 2, if i host licode in a public vps, and invite my friend for testing  
> > the service, he as a presenter has a camara, could send stream to me (as  
> > the viewer)  
> > but the video play on myside only insists for seconds, and then it  
> > shows black screen.  
> > 3, i am now on my office(behind another router), and i could subscribe  
> > his stream and play that for long times
> > 
> > My guess:
> > 
> > i knew webrtc’s p2p communication need to do udp hole punching, and  
> > from the effects of above step 2, it successed. but some nat
> > 
> > seems would disable the punching if his inner client dont send data  
> > through that port, in my case, as a viewer role, my browser wont sent
> > 
> > data throught that port except the begining connecting steps, that  
> > explained why myside could receive the stream at the begining and after a
> > 
> > while, it stop, just because it wont sent data back after connected, so  
> > the router would disable that port
> > 
> > the above is all my guess, i dont know if it’s the true, if that, i  
> > think maybe you guys need consider send heartbeat packages between peers
> > 
> > for consist the connection
> > 
> > BTW, can anyone tell me how many events there? i cant find any documents  
> > about that
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “lynckia” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [lynckia+unsubscribe@googlegroups.com](mailto:lynckia+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> –  
> You received this message because you are subscribed to a topic in the  
> Google Groups “lynckia” group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/lynckia/7Etzo2SEBY0/unsubscribe](https://groups.google.com/d/topic/lynckia/7Etzo2SEBY0/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [lynckia+unsubscribe@googlegroups.com](mailto:lynckia+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

–  
Name: yunfan  
Location: China/Beijing  
Site: [http://geek42.info/](http://geek42.info/)  
IM:

- gtalk: jyf1987 at gmail dot com
- irc: [irc.freenode.net/#ubuntu-cn](http://irc.freenode.net/#ubuntu-cn)  
Interest:
- Lang: [forth, clojure, c, python, lua]
- software: [nginx, redis]
- abstract: [vm, tiny, cloud, html5]
- history
- science-fiction
- music: [new-age, vangelis, yanni]
