[英]using FFmpeg for android without any C/C++ or make knowledge
I would like to use FFmpeg library on my android app. 我想在我的Android应用程序上使用FFmpeg库。 I have no C/C++/Make knowledge and all the threads I've been reading about it talk about stuff I completely don't understand.
我没有C / C ++ / Make的知识,并且我一直在阅读的所有线程都在谈论我完全不了解的内容。
Is there any pre-compiled library which I can add to my project, then add a simple 'import' statement on my java class and then call it? 是否可以将任何预编译的库添加到项目中,然后在Java类上添加简单的“ import”语句,然后调用它?
Thanks 谢谢
Is there any particular reason why you need exactly FFmpeg? 有什么特别的原因为什么您需要FFmpeg? I guess it could be possible to get prebuilt binaries, but since it is a C library, you would also need a JNI wrapper code - I don't think anyone would generate that for the whole library since it's quite large, so even with a prebuilt library you still need to have some JNI knowledge to wire through the communication between Java and FFmpeg in C. Just for the purpose of demonstration - here is an example.
我猜可能有可能获得预构建的二进制文件,但是由于它是C库,因此您还需要JNI包装器代码-我认为没有人会为整个库生成该代码,因为它很大,所以即使使用预构建的库,您仍然需要一些JNI知识,以通过Java和FFmpeg在C语言之间的通信进行连接。仅出于演示目的- 这是一个示例。
Apart from that if there is not a special reason to use FFmpeg, why can't you stick with MediaCodec that is a part of the Android API? 除此之外,如果没有特殊的原因使用FFmpeg,为什么不坚持使用Android API的MediaCodec ? It wraps the native StageFright library and could provide hardware support on devices where it is available, while FFmpeg would be a CPU only solution.
它包装了本机StageFright库,并且可以在可用的设备上提供硬件支持,而FFmpeg将是仅CPU的解决方案。 Of course, if some unpopular codecs or muxers that are not available in MediaCodec are needed, then FFmpeg is the way.
当然,如果需要一些MediaCodec中不受欢迎的编解码器或复用器,则可以使用FFmpeg。
您可以使用JavaCPP Presets中的预编译库以及FFmpegFrameRecorder
的FFmpegFrameRecorder来压缩图像和音频样本,例如,如RecordActivity样本所示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.