用于基于视频的应用程序的 Java:好的选择?
我正处于一个应用程序的概念阶段,该应用程序将有大量音频/视频输入和输出。 我想用Java来做; 但不知何故我还没有完全相信。 你怎么认为? 到底能有多糟糕? 有什么建议吗?
为什么我想到 Java:
- 这是我最熟悉的语言。
- 更轻松的跨平台迁移将是一个额外的好处。
- 买不起商业平台(如 .NET)或其他免费替代方案(如 Python)不够好,
- 我也稍微倾向于 C++/Qt; 但这对我来说需要更多时间,因为我在这方面不太擅长,而且我有点担心可维护性。
I am in the concept phase of an application that is going to have a lot of Audio/Video input and output. I want to do it in Java; but somehow am not fully convinced yet. What do you think? How bad could it be? And any advices?
Why I am thinking Java:
- It's the language I'm most comfortable with.
- Easier cross platform migration would be a bonus.
- Cannot afford commercial platforms (like .NET) or not good enough in other free alternatives (like Python)
- I'm also slightly inclined towards C++/Qt; but that would take more time for me as I'm not great in that and I am a bit worried about maintainability.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
如果您有兴趣,请查看 Xuggler。 它展示了 FFmpeg 的所有功能,但作为在 Windows、Mac 和 Linux 上运行的 Java API。 优点是您可以从 Java 获得 FFmpeg 的所有功能。 缺点是它需要安装 FFmpeg 本机 DLL/共享库。
If you're interested, check out Xuggler. It exposes all the power of FFmpeg, but as a Java API that runs on Windows, Mac and Linux. The advantage is you get all the power of FFmpeg but from Java. The disadvantage is it requires the FFmpeg native DLLs/shared-libraries to be installed.
音频和视频意味着您将处理每个受支持平台的专用本机库和 JNI 包装器; 在这种情况下,Java 的跨平台论点并不真正适用。
Audio and video means you will be dealing with dedicated native libraries and JNI-wrappers for each supported platform; in this case, the cross-platform argument for Java does not really apply.
我相信,当您想编写音频/视频应用程序时,您将使用的编程语言是第二重要的事情。 最重要的是您的应用程序将使用的音频/视频框架,因为这定义了您的功能。
我知道两个流行的通用视频框架可用于访问大多数多媒体类型:Directshow 和 ffmpeg。 Directshow与windows捆绑在一起,所以只剩下ffmpeg了。
FFmpeg 在 windows 和 unix 上都有版本,尽管它是用 C 编写的,但它可以在多种语言中使用。
甚至还有许多 ffmpeg 的 java 包装器(例如,看看 xuggle)!
I believe that when you want to write an audio/video application, the programming language you will use is the second most important thing. The most important thing is the audio/video framework your application will use since this is what defines your capabilities.
I am aware of two popular generic video frameworks that can be used to accesd most multimedia types: Directshow and ffmpeg. Directshow is tied with windows, so only ffmpeg is left.
Ffmpeg has versions in both windows and unix and, although it is written in C, it can be used from a lot of languages.
There is even a number of java wrappers for ffmpeg (for instance, take a look at xuggle)!
C++ 将是首选,因为音频/视频处理中经常存在性能问题以及视频/音频可用库的范围。
您确实对熟悉 Java 提出了很好的观点。 如果你时间紧迫,这一点就更重要了。 不过,如果你能抽出一些时间来学习,C++ 将是非常值得的。
关于 .NET:.NET SDK 包含您所需的一切 可免费下载。 获取一个免费的 IDE,例如 SharpDevelop 即可启动并运行。 Visual Studio是要花钱的,你不需要Visual Studio来做.NET开发。
C++ would be the first choice because of performance concerns often present in Audio/Video processing as well as the range of available libraries for video/audio.
You do make a good point about being familiar with Java. If you are pressed for time, this is even more important. However if you can spare some time for learning, C++ would be well worth it.
Regarding .NET: The .NET SDK with everything you need is freely downloadable. Get hold of a free IDE such as SharpDevelop and you are up and running. It's Visual Studio that costs money, you don't need Visual Studio to do .NET development.
Rusty.in,
尝试一下 JavaFX 媒体 API。 最近,JavaFX 的版本是 1.2.0,也带有 GUI 应用程序。 它支持 Swing。 语法基于脚本风格; 但是,您可以将现有的 Swing 组件部署到 JavaFX 中。
我希望它有帮助。
老虎
Rusty.in,
How about trying to do JavaFX Media API. Recently, the version of the JavaFX is 1.2.0 with GUI Application as well. It supports the Swing. The grammar is based on the script style; however, you can deploy the existing Swing components into the JavaFX.
I hope it helps.
Tiger
鲁斯蒂,你最后做了什么? 我也想做一个视频应用程序,但我真的更喜欢 Java/JavaFX 而不是 C++。 关于使用 Flash 和/或当前 JavaFX 视频支持的问题是 Flash 视频播放不是帧精确的。 我确实需要能够像使用 QuickTime 一样停止/启动/步进各个帧。
有人尝试过使用 Xuggler 和 Java/JavaFX 进行播放吗?
Rusty, what did you wind up doing? I too have a video app I'd like to do, but really would prefer Java/JavaFX over C++. The thing about the using Flash and/or the current JavaFX video support is that Flash video playback is not frame-accurate. I really need to be able to stop/start/step on individual frames like you can with QuickTime.
Has anyone tried doing playback with Xuggler and Java/JavaFX?