安卓 NDK.如何播放视频. [英] Android NDK. How to play video.

查看:37
本文介绍了安卓 NDK.如何播放视频.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 Android 设备上播放视频(不同格式).据我所知,最好的方法是将 Android NDK 与可以播放视频的特定库一起使用.我做了一些基本的例子来了解NDK的用法,但我不知道下一步该怎么做.据我了解,我必须首先安装 ffmpeg.所以我有以下问题:

I need to play video on Android device (different formats). As I have understand, the best way is to use Android NDK with specific libraries that can play video. I have done some basic examples to understand NDK usage, but I don't know what to do next. As I have understood, I must install ffmpeg first of all. So I have the following questions given below:

  1. 我需要 ffmpeg(最好的方法是使用 Linux,而不是 Windows,因为在 Windows 中,它的安装存在一些问题).
  2. 如何播放视频的声音?
  3. 我了解到一些开源库可以毫不费力地播放视频.我的工作是为他们提供字节数组或 SD 视频的路径.对吗?

那么,谁能帮我解释一下如何用ndk播放视频的基本方法,可能是一些基本的计划或链接?非常感谢您对我的问题感兴趣!

So, can anyone help me and explain basic ways how to play video with ndk, may be some basic plan or links? Thank you very much for interest to my question!

推荐答案

好的,先从你的问题开始;您必须决定是要Manipulate Video 还是只Play video.如果您只是播放视频/音频,则不需要 external lib. 像 Ffmpeg.

Ok firstly starting with your problem; you have to decide whether you want Manipulate Video or just Play video. If you are just playing video/audio then there is no need for external lib. like Ffmpeg.

但是如果您要操作音频/视频,那么请选择Ffmpeg.然后决定你是想要一个现成的编译过的 Ffmpeg 库还是想要使用自定义标志设置进行 Compile via NDK.

But if you are manipulating audio/video then go for Ffmpeg. Then decide whether you want a ready compiled Ffmpeg library or want to pursue for Compile via NDK with custom flag settings.

如果您可以使用现成的 Ffmpeg 库. 那么您可以使用这个 App 并帮助在 此处.

If you can do with ready Ffmpeg lib. then you can use this App and help for integrating it at here.

但是,如果您要制作 *.so 或通过 ndk 自己编译 Ffmpeg,那么请参阅这些 关于 FFmpeg for Android 的 Stackoverflow 帮助.在这里您可以进行自己的设置.您还可以使用 Precompiled 库.直接从 Github/Roman10

But if you are going for making the *.so or compile Ffmpeg on your own via ndk then see these Stackoverflow Help on FFmpeg for Android. Here you can have your own settings. You also can use the Precompiled lib. of Ffmpeg directly which is available at Github/Roman10

现在回答您的问题:-

  1. 同上

取决于您是否正在提取然后Ffmpeg Doc1 或只是播放声音然后 Stackoverflow 链接

Depends whether you are extracting then Ffmpeg Doc1 or just playing sound then Stackoverflow link

只需查看 Android 文档,即可玩游戏,视频

Play simply by looking at Android Docs,Video

干杯..!

这篇关于安卓 NDK.如何播放视频.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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