通过ajax请求从Java servlet流传输实时视频提要的正确方法 [英] Proper way to stream live video feed from java servlet via ajax request

查看:644
本文介绍了通过ajax请求从Java servlet流传输实时视频提要的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在创建自定义监视应用程序.我很好奇,是否有可能获取实时流并通过ajax请求将其重定向到网页.如果是这样,那么如何显示ajax请求的示例如何.我正在使用Java处理视频供稿方面,并计划使用Servlet将视频供稿推送到用户在相应网页上的请求.

Im currently creating a custom surveillance application. And i was curious is it possible to take the live stream and and redirect it to a webpage via an ajax request. If so whats an example of how the ajax request would look. I'm working on the video feed aspect with java and was planning on using a servlet to push video feed to a request by the user whos on the appropriate webpage.

推荐答案

仅通过使用ajax + servlet不能做到这一点,但是您需要具有媒体流服务器来生成流,并且可以使用servlet(和ajax) )以将其重定向到自定义页面.

Only by using ajax + servlet you can not do that, but you need to have a media streaming server to generate the streaming and you can use servlet (and ajax) to redirect it to the custom page.

一个很好的开源媒体流服务器,它是用Java开发的 Red5服务器.他们有一个称为 red5-web 的特殊模块,只需几个配置即可简单地用于您的需求.它使用RTP/RTMP协议来做到这一点.

one good open source media streaming server I can suggest is the Red5 server developed with Java. They have a special module called red5-web which you can simply used for your requirement with a few configurations. It uses RTP/RTMP protocols to do that.

引用

refer HERE for nice tutorial.

您还可以使用 VLCJ 来引用 HTTP流. 可以找到一个很好的例子 HERE

And also you can refer to HTTP streaming also using VLCJ. A very good example can be found HERE

希望您可以通过这些链接获得帮助.

I hope you can get a help through those links.

这篇关于通过ajax请求从Java servlet流传输实时视频提要的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆