使用FFMPEG在Android [英] Use FFMPEG on Android

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

问题描述

是否有人知道如何使用FFMPEG在Android上,以YUV420帧转换为H.264?

Does somebody know how to use FFMPEG on Android to convert YUV420 frame to H.264?

我已经移植FFmpeg的工作,NDK,我只是不知道如何使用它。一位知情人士code是AP preciated。

I have ported FFMPEG work on Android with NDK, I just don't know how to use it. A source code is appreciated.

推荐答案

您有两种选择:

  1. 使用的ffmpeg API - 谷歌的ffmpeg 样品code。这需要良好的 该API并理解 很COM prehnsive。
  2. 编译ffmpeg.c并调用它 主()通过JNI。这要求 你理解了命令行 参数。它是相当麻烦的 但工程。

  1. use ffmpeg api - google ffmpeg sample code. this requires good understanding of the api and which is very comprehnsive.
  2. compile ffmpeg.c and invoke its main() via jni. This requires that you understand the command line parameters. It is rather cumbersome but works.

您需要留意的ffmpeg.c中定义的静态VAR和每次调用主函数时重新设置。另外,还要确保你不要调用主的同时两个线程。

You need to look out for the static vars defined in ffmpeg.c and reset them every time you invoke the main function. Also make sure you don't invoke the main in two threads simultaneously .

这篇关于使用FFMPEG在Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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