简体   繁体   English

在现有Java应用程序中集成Red5 Server

[英]Integrate Red5 Server in existing Java application

In my Java Application, I need to create an RTMP (or RTSP) livestream server and feed raw RGB image data to it. 在我的Java应用程序中,我需要创建一个RTMP(或RTSP)直播服务器并向其提供原始RGB图像数据。

I'd like to use the Red5 Server project , as it is available via Maven and the Apache 2.0 license fits my needs. 我想使用Red5 Server项目 ,因为它可以通过Maven获得,Apache 2.0许可证符合我的需求。
However, I haven't found any introduction tutorials on how to start and feed a livestream server from within a standalone Java Application. 但是,我没有找到任何关于如何从独立Java应用程序中启动和提供直播服务器的介绍教程。 I have already added the dependency to my project, and can access all of Red5's classes. 我已经将依赖项添加到我的项目中,并且可以访问Red5的所有类。

Can you point me to any resources that help me getting started? 你能指点我帮助我入门的任何资源吗? The task I'm trying to accomplish seems pretty basic to me. 我想要完成的任务对我来说似乎很基础。

With Red5 you have the control to handle the "input" in any means you want, from a servlet that accepts octet-streams, to pretty much anything else you can think up. 使用Red5,您可以控制以任何方式处理“输入”,从接受八位字节流的servlet,到几乎任何你能想到的东西。 So if your input is RGB data, implement something that accepts your byte arrays (like a servlet) and then convert it into one of the Flash supported video codecs, such as h.264; 因此,如果您的输入是RGB数据,请实现接受字节数组(如servlet)的内容,然后将其转换为Flash支持的视频编解码器之一,例如h.264; you can use ffmpeg or jcodec to do this. 你可以使用ffmpeg或jcodec来做到这一点。 Lastly, you'll want to package the now encoded data into FLV format, that's more difficult, but there are non-red5 examples of how to do this on the net, google for it. 最后,你需要将现在编码的数据打包成FLV格式,这比较困难,但是有一些非red5的例子说明如何在网上为谷歌做这件事。 Once you have it in the FLV format, create a broadcast stream and dispatch the VideoData to it. 一旦你以FLV格式获得它,创建一个广播流并将VideoData发送给它。 Sounds simple right? 听起来很简单吧? Its not, but if you are a proficient in Java and / or C/C++, you should be fine. 它不是,但如果你精通Java和/或C / C ++,你应该没问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM