使用 Java 的实时视频流?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1244861/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 07:23:35  来源:igfitidea点击:

Live video streaming using Java?

javavideo-streaming

提问by Gili

Are there any good libraries for streaming live video using Java? Ideally both ends of the pipe should be written in Java but I am mostly concerned about the video player. What software would you recommend?

是否有使用 Java 流式传输实时视频的好库?理想情况下,管道的两端都应该用 Java 编写,但我最关心的是视频播放器。你会推荐什么软件?

UPDATE: It seems that VLC introduces a 1-2 second delay. I need video streaming that is truly live. The record-to-playback delay must be under 300ms.

更新:似乎 VLC 引入了 1-2 秒的延迟。我需要真正实时的视频流。录制到回放的延迟必须低于 300 毫秒。

采纳答案by stribika

The best video playback/encoding library I have ever seen is ffmpeg. It plays everything you throw at it. (It is used by MPlayer.) It is written in C but I found some Java wrappers.

我见过的最好的视频播放/编码库是ffmpeg。它播放你扔给它的一切。(它被 MPlayer 使用。)它是用 C 编写的,但我发现了一些 Java 包装器。

  • FFMPEG-Java:使用 JNA 围绕 ffmpeg 的 Java 包装器。
  • jffmpeg:这个集成到 JMF 中。

回答by thedude19

You could always check out JMF (Java Media Framework). It is pretty old and abandoned, but it works and I've used it for apps before. Looks like it handles what you're asking for.

您可以随时查看JMF(Java 媒体框架)。它很旧而且已经废弃了,但它可以工作,而且我以前将它用于应用程序。看起来它可以处理您的要求。

回答by 4NDR01D3

Hi not an expert in streaming but my understanding is that it is included in th Java Media Framework JMF http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/support-rtsp.html

嗨不是流媒体专家,但我的理解是它包含在 Java 媒体框架 JMF http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/support-rtsp.html

回答by Art Clarke

You can do this today in Java with the Red5media server from Flash. If you want to also decode and encode video in Java, you can use the Xugglerproject.

您现在可以使用Flash的Red5媒体服务器在 Java 中完成此操作。如果您还想用 Java 对视频进行解码和编码,可以使用Xuggler项目。

回答by Darkoofthedark

JMF was abandoned. VLC is more up to date and it reads everything. https://stackoverflow.com/a/5160010

JMF 被放弃了。VLC 是最新的,它可以读取所有内容。 https://stackoverflow.com/a/5160010

I think vlc beats every other software out there yet, or at least the ones that I know...

我认为 vlc 击败了所有其他软件,或者至少我知道的那些......

回答by Dev Sabby

Yes if you want to stream live video you can use RTSP protocothis will allow you to create a video file, which can be play while creating, both operation will work simultaneously. RTSP-Client-Server

是的,如果您想流式传输实时视频,您可以使用RTSP 协议,这将允许您创建一个视频文件,该文件可以在创建时播放,这两个操作将同时进行。RTSP-客户端-服务器