简体   繁体   中英

using FFmpeg for android without any C/C++ or make knowledge

I would like to use FFmpeg library on my android app. 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.

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?

Thanks

Is there any particular reason why you need exactly 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.

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? 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. Of course, if some unpopular codecs or muxers that are not available in MediaCodec are needed, then FFmpeg is the way.

You can use Xuggler for encoding and decoding audio and video. Their wesite says "Xuggler extensively uses FFmpeg to compress and uncompress media".

您可以使用JavaCPP Presets中的预编译库以及FFmpegFrameRecorderFFmpegFrameRecorder来压缩图像和音频样本,例如,如RecordActivity样本所示。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM