如何在android中构建和使用ffmpeg [英] How to build and use ffmpeg within android

查看:163
本文介绍了如何在android中构建和使用ffmpeg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我原型相机是一个相当简单的相机应用程序来测试使用MediaRecorder创建一个自定义相机活动与一个snag,我想将录制的视频的宽高比设置为1x1。通过大量研究,我发现只有通过使用像FFMPEG这样的图像才能将视频的每一帧裁剪成我想要的尺寸。



我已经阅读了许多教程和文章,以不同的方式将FFMPEG构建到Android中,但大多数教程和文章都已经过时,并且使用旧版本的Android NDK和FFMPEG,或者更近的那些只是不按时工作。我尝试遵循流行的 http://www.roman10.net/how-to-build- ffmpeg-for-android / 和其他几个类似的都会导致关于缺少pkg-config文件的错误,因为FFMPEG通常意在安装在linux或其他操作系统上。我找到一些关于在an​​droid中使用make-standalone-toolchain.sh文件构建FFMPEG的信息 http://software.intel.com/en-us/android/blogs/2013/12/06/building-ffmpeg-for-android-on-x86 并且不能使头或尾部如何使用这种方法。



这现在引发了我的问题:目前在Android应用程序中构建和使用FFMPEG的最好/可行的方法是什么?如果单独的工具链方法是要走的路,那么有没有比所列出的更容易遵循的材料更好的材料?我甚至可以开放可靠的模板应用程序与FFMPEG库准备(如果这是可能的话);虽然,我宁愿知道如何将其构建到Android中以备将来使用。



提前感谢您就此问题提供任何建议或意见。

解决方案

这是我最喜欢的指南: http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/



如果您需要更多选项,您可以看看这些,这同样是好的:





编辑:我更新了首先链接最近的文章(它使用 NDK r9 )。


I am prototyping a fairly simple camera app to test out using MediaRecorder to create a custom camera activity with one snag, I want to set the aspect ratio of recorded videos to a 1x1. Through much research I have found that this is only possible by using a library like FFMPEG to crop each frame of the video to the size I desire.

I have read many tutorials and articles on different ways to build FFMPEG into Android, but most of them are either outdated and use older versions of both the Android NDK and FFMPEG, or more recent ones just do not work when followed. I tried following the popular http://www.roman10.net/how-to-build-ffmpeg-for-android/‎ and a few other similar ones that all lead to an error about a missing pkg-config file because FFMPEG is generally meant to be installed on linux or another OS apparently. I found some information about building FFMPEG in android by using a make-standalone-toolchain.sh file here http://software.intel.com/en-us/android/blogs/2013/12/06/building-ffmpeg-for-android-on-x86 and can't make heads or tails as to how to go about using this method.

This now leads into my question: What is the best/proven way currently to build and use FFMPEG within android applications? If the standalone toolchain method is the way to go, is there any material better than the one listed that is easier to follow? I would even be open to a reliable template application with the FFMPEG Libraries ready to go (if this is possible); although, I would much rather know how to build this into android for future use.

Thank you in advance for any advice or suggestions on this issue.

解决方案

This is the guide I liked the most: http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/

If you need more options, you can take a look at these, which are equally good:

EDIT: I updated the first link with a more recent article (it uses NDK r9).

这篇关于如何在android中构建和使用ffmpeg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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