关于java 多媒体处理的问题

前端琅琊阁 2014-11-16 04:38:08
各位大神,最近有朋友托我制作一个自动处理视频并生成目标视频的程序,需求倒是简单,也不需要华丽的UI
(囿于adode premiere等视频编辑软件,人工操作容易出差错,生成视频速度慢等问题,暂时不打算采用)

处理过程大致是:有一个固定的背景视频和音频,然后在该视频时间轴的固定几个位置插入帧(就是拍的图片)。每次读入的图片是不一样的,但是插入的位置是一样的。然后生成加入图片后的视频!

小弟搜到 JMF ,FMJ等类库,可以用于多媒体处理,但没找到读入视频流,加入帧处理的相关资料。
想问下各位,读入素材后,java 多媒体处理类库能完成此操作嘛?或者C++能更好的处理,也请大神指引!
以下是我搜的一些资料:
开源框架
http://www.oschina.net/project/tag/142?lang=19
JAVA制作流媒体
http://blog.csdn.net/a352193394/article/details/7330632
使用JMF编写同时提取视频流和音频流并且播放的案例
http://blog.csdn.net/hangke/article/details/2066525
jmf语音视频流抓取
...全文
179 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
前端琅琊阁 2014-11-16
  • 打赏
  • 举报
回复
从视频导出的效率来讲,我决定放弃使用别人普通类库或者FMJ类库开发,我看看能不能试试开发adobe premiere的插件来完成这个任务。
前端琅琊阁 2014-11-16
  • 打赏
  • 举报
回复
怎么,没人回帖啊,以下是我在stackoverflow搜的资料,使用了别人的代码,感觉代码导出视频效率低! http://stackoverflow.com/questions/9334062/recommended-java-library-for-creating-a-video-programmatically http://www.randelshofer.ch/blog/2010/10/writing-quicktime-movies-in-pure-java/ Question: Can anyone recommend a Java library that would allow me to create a video programmatically? Specifically, it would do the following: take a series of BufferedImages as the frames allow a background WAV/MP3 to be added allow 'incidental' WAV/MP3s to be added at arbitrarily, programmatically specified points output the video in a common format (MPEG etc) Can anybody recommend anything? For the picture/sound mixing, I'd even live with something that took a series of frames, and for each frame I had to supply the raw bytes of uncompressed sound data associated with that frame. P.S. It doesn't even have to be a "third party library" as such if the Java Media Framework has the calls to achieve the above, but from my sketchy memory I have a feeling it doesn't. Answer: I've used the code mentioned below to successfully perform items 1, 2, and 4 on your requirements list in pure Java. It's worth a look and you could probably figure out how to include #3. http://www.randelshofer.ch/blog/2010/10/writing-quicktime-movies-in-pure-java/ I found a tool called ffmpeg which can convert multimedia files form one format to another. There is a filter called libavfilter in ffmpeg which is the substitute for vhook which allows the video/audio to be modified or examined between the decoder and the encoder. I think it should be possible to input raw frames and generate video. I researched on any java implementation of ffmpeg and found the page titled"Getting Started with FFMPEG-JAVA" which is a JAVA wrapper around FFMPEG using JNA. Why not use FFMPEG? There seems to be a Java wrapper for it: http://fmj-sf.net/ffmpeg-java/getting_started.php Here is an example of how to compile various media sources into one video with FFMPEG: http://howto-pages.org/ffmpeg/#multiple And, finally, the docs: http://ffmpeg.org/ffmpeg.html

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧