简体   繁体   English

在JAVA中保护流音频/视频

[英]Secure streaming audio/video in JAVA

I'm doing project for my university and I'm stuck with several problems. 我正在为我的大学做项目,但遇到了一些问题。 It's a team project, so we designed an app which core functionality would be secure streaming AV from few cameras (our destination target are IP cameras). 这是一个团队项目,因此我们设计了一个应用程序,其核心功能是从几台摄像机(我们的目标服务器是IP摄像机)安全地流AV。 We assumed that JMF is not enough for us, so we have found OpenCV library which has JAVA API what is ideal for us since JAVA is our language of choice but I am aware that languages such as C++ would done better for this kind of work, but we haven't sufficient experience and a little time remaining. 我们认为JMF对我们来说还不够,因此我们发现具有JAVA API的OpenCV库非常适合我们,因为JAVA是我们选择的语言,但是我知道C ++之类的语言可以更好地完成此类工作,但是我们没有足够的经验,还有一点时间。

What we have accomplished for now: 我们目前已完成的工作:

  • We have found and tested ZRTP protocol implementation ZRTP4J and we want to used it for secure transmission (no one should be able to overhear a conversation and now we are also thinking about certification so we would authorize the caller) 我们已经找到并测试了ZRTP协议实现ZRTP4J,并且希望将其用于安全传输(没有人应该能够听到对话,现在我们也在考虑认证,因此我们将授权调用方)
  • We can capture frames from the webcam using OpenCV but we have problems with transmitting it via RTP using JMF implementation of this protocol 我们可以使用OpenCV从网络摄像头捕获帧,但是使用该协议的JMF实现通过RTP传输帧时存在问题
  • We can encode captured sequence of frames to specific format using Xuggler library and pack it to media container 我们可以使用Xuggler库将捕获的帧序列编码为特定格式,并将其打包到媒体容器中

In other words we have frames captured by OpenCV, we want to mux captured frames with captured audio from a microphone and send it over RTP protocol which uses UDP in transport layer. 换句话说,我们有OpenCV捕获的帧,我们希望将捕获的帧与麦克风捕获的音频混合,并通过RTP协议将其发送,该协议在传输层使用UDP。 The question is how to do this properly? 问题是如何正确执行此操作? Should we use some muxer before streaming and demuxer on the output? 在输出流和解复用器之前,我们应该使用一些复用器吗? Or maybe we should have 2 different streams, first for the video and latter for audio? 或者,也许我们应该有2种不同的流,首先是视频流,然后是音频流?

The JMF itself is other problem. JMF本身是另一个问题。 We have to care about its AV formats applicable for RTP transmition and its API is rough and mastering it takes much time for us and the fact that this library is old and not developed anymore doesn't motivate us at all. 我们必须关心其适用于RTP传输的AV格式,并且它的API很粗糙,而且掌握它对我们来说要花费很多时间,而且这个库过时了而且不再开发了,这一事实根本不会激发我们的兴趣。 Could someone of you point some tested, verified RTP implementation for JAVA? 你们中的某人可以指出一些经过测试,验证的JAVA RTP实现吗? We are also open for other propositions, maybe we are mistaken at more points in our design. 我们也对其他主张持开放态度,也许我们在设计的更多方面犯了错误。

Thank you in advance! 先感谢您! Hubert 休伯特

There is no need to use muxer and demuxer in streaming video and audio frames. 在流视频和音频帧中无需使用多路复用器和多路分配器。 You should use 2 streams, one for video and the other for audio. 您应该使用2个流,一个用于视频,另一个用于音频。 I recommend you read RFC3550. 我建议您阅读RFC3550。

Maybe you could try this Java RTP library jlibrtp 也许您可以尝试这个Java RTP库jlibrtp

ZRTP4J is a library for key negotiation. ZRTP4J是用于密钥协商的库。 you still need a SRTP library to encrypt and decrypt packets. 您仍然需要SRTP库来加密和解密数据包。 The SRTP library may use the key obtained from ZRTP. SRTP库可以使用从ZRTP获得的密钥。 I've found a open source project jitsi-jingle using SRTP. 我找到了一个使用SRTP的开源项目jitsi-jingle

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

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