我怎样才能使与MP3音频文件和图像3GP视频? [英] How can I make 3gp video with mp3 audio file and images?

查看:139
本文介绍了我怎样才能使与MP3音频文件和图像3GP视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过结合一个mp3音频剪辑和我的Andr​​oid应用程序的映像来创建一个3GP视频文件。那是:
MP3 +图像= 3GP视频片段。

I am trying to create a 3gp video file by combining an mp3 audio clip and an image for my android application. That is: mp3 + image = 3gp video clip.

我做这个这么多的研究,但发现可用的帮助是有限的。

I did so much research on this but found that help available was limited.

请让我知道如何做到这一点。

Please let me know how to do this.

推荐答案

如果你正在寻找做您的应用程序的外面,然后检查了<一个href=\"http://stackoverflow.com/questions/3132774/add-an-image-to-mp3-and-convert-it-to-a-video-file-using-ffmpeg\">this帖子,它给出了可用于实现相同的ffmpeg命令

If you are looking to do that outside of your application then check out this post which gives ffmpeg command that can be used to achieve the same.

同样的ffmpeg也可以编译为Android和使用JNI用作这个帖子讨论。

Also ffmpeg can also be compiled for android and used using the JNI as discussed in this post.

复制为快速参考最佳答案:

copying the best answer for quick reference:

下面是通过获得的ffmpeg我去的步骤,以在Android上工作:

Here are the steps I went through in getting ffmpeg to work on Android:


  1. 构建的ffmpeg的静态库为Android。这是通过取得
    建筑olvaffe的ffmpeg的机器人端口( libffmpeg )使用的 Android版
    构建系统
    。只要把源下/外部和制作
    远。你需要从仿生提取(libc中)和zlib(libz进行)
    Android的建设,以及作为的ffmpeg库依赖它们。

  2. 使用创建一个动态库,包装功能的ffmpeg
    Android的NDK。有很多资料在那里就如何配合工作
    NDK。基本上,你需要写一些C / C ++ code导出
    功能需要进行的ffmpeg到库Java可以
    通过JNI交互。 NDK的让你轻松对抗链接
    在步骤1中已经生成的静态库,只需添加一行
    与此类似,以Android.mk: LOCAL_STATIC_LIBRARIES:= libav codeC
        libavformat流libavutil的libc libz进行

  3. 从Java源代码使用的ffmpeg-包裹动态库。有一个关于JNI足够的证明文件在那里,你应该罚款。

  1. Build static libraries of ffmpeg for Android. This was achieved by building olvaffe's ffmpeg android port (libffmpeg) using the Android Build System. Simply place the sources under /external and make away. You'll need to extract bionic(libc) and zlib(libz) from the Android build as well, as ffmpeg libraries depend on them.
  2. Create a dynamic library wrapping ffmpeg functionality using the Android NDK. There's a lot of documentation out there on how to work with the NDK. Basically you'll need to write some C/C++ code to export the functionality you need out of ffmpeg into a library java can interact with through JNI. The NDK allows you to easily link against the static libraries you've generated in step 1, just add a line similar to this to Android.mk: LOCAL_STATIC_LIBRARIES := libavcodec libavformat libavutil libc libz
  3. Use the ffmpeg-wrapping dynamic library from your java sources. There's enough documentation on JNI out there, you should be fine.

关于使用ffmpeg的播放,有很多例子(FFmpeg的二进制文件本身就是一个很好的例子),这里的基本教程。最好的文档可以在标题中找到。

Regarding using ffmpeg for playback, there are many examples (the ffmpeg binary itself is a good example), here's a basic tutorial. The best documentation can be found in the headers.

这篇关于我怎样才能使与MP3音频文件和图像3GP视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆