admin管理员组文章数量:1415467
I have a client program and a server program. The server is on my localhost and it has my .mpeg video.
Using node JS I am supposed to stream a video from a server. The client requests messages, such as play/pause/resume/rewind etc. so I guess I have to use RTSP, to figure out what to send over the RTP. But I don't know from where to start.
All I have so far is the RegEx to filter the message, for example on the client there are buttons like play/pause/setup etc. so I can grab that text. And I have a switch. But if I get setup what I should I do?
P.S I am not allowed to use RTSP modules or RTP modules. Gotta do it all from scratch.
I have a client program and a server program. The server is on my localhost and it has my .mpeg video.
Using node JS I am supposed to stream a video from a server. The client requests messages, such as play/pause/resume/rewind etc. so I guess I have to use RTSP, to figure out what to send over the RTP. But I don't know from where to start.
All I have so far is the RegEx to filter the message, for example on the client there are buttons like play/pause/setup etc. so I can grab that text. And I have a switch. But if I get setup what I should I do?
P.S I am not allowed to use RTSP modules or RTP modules. Gotta do it all from scratch.
Share Improve this question edited Feb 15, 2013 at 4:41 twix asked Feb 15, 2013 at 3:33 twixtwix 111 silver badge4 bronze badges 9- 2 Could you improve that title? It's truly meaningless to me. – John Saunders Commented Feb 15, 2013 at 3:57
- how do you want me to improve it? – twix Commented Feb 15, 2013 at 4:20
- What is your problem with your "RTP?RTSP implementation in javascript" – John Saunders Commented Feb 15, 2013 at 4:22
- I don't know from where to start. I made my server grab requests from the client such as pause,play resume. but when I get these mands what do I do? I have the video.mpeg how do I use the rtp to send it to the client – twix Commented Feb 15, 2013 at 4:27
- are you using html5 with websocket? – thang Commented Feb 15, 2013 at 4:45
1 Answer
Reset to default 3When streaming mpeg file over the wire you will have to tackle RTSP and RTP separately. RTSP is used for signaling, session establishing and starting the underlying RTP stream.If you need to do this in node.js, I remend loading a library that already implements RTSP/RTP(creating your own is quite a undertaking, but it is doable as well).
Some info on loading c++ libraries in node.js that: How can I use a C++ library from node.js?
So basically, from you mpeg file, you need to extract raw h264 stream. For this I remend ffmpeg or some other libraries/code that understands mpeg file structure. Then you need to packetize the encoded frames inside of RTP packets; which you will then send back to the client from the server. The client will then depacketize the encoded frames into actual frame; and then decoded/display them on the screen .
I remend reading http://www.ietf/rfc/rfc3984.txt for info on standard way to packetize H264 video.
This is all very general approach, but it gives you a general idea. Hopefully this info helps, good luck.
本文标签: RTP RTSP implementation in javascriptStack Overflow
版权声明:本文标题:RTP RTSP implementation in javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745156333a2645193.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论