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

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

问题描述

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


  1. 我需要有ffmpeg(最好的方法是使用Linux,而不是Windows,
    ,因为在Windows中安装有一些麻烦)。

  2. 如何播放视频?

  3. 我已经阅读一些开放源代码的图书馆无需任何努力即可播放视频。我的工作是在SD上给他们字节数组或路径。这是对的吗?

所以,任何人都可以帮助我,并解释如何用ndk播放视频的基本方法,可能是一些基本计划或链接?
非常感谢您的关注我的问题!

解决方案

首先从你的问题开始,您必须决定是否要操纵视频或只需播放视频。如果你只是播放视频/音频,那么不需要 external lib。像Ffmpeg。



但是你是操纵音频/视频,然后去 Ffmpeg 。然后决定是否要一个准备好的编译的 Ffmpeg 库,或者想追求通过NDK编译与自定义标志设置。 / p>

如果你可以做好准备 Ffmpeg lib。那么你可以使用这个 App ,并帮助将其集成到 here



但是,如果你要做 *。所以或者通过 ndk 自己编译Ffmpeg,然后看看这些适用于Android的FFmpeg上的Stackoverflow帮助。在这里你可以有自己的设置。
您还可以使用预编译的 lib。的Ffmpeg直接在 Github / Roman10



现在就您的问题: -


  1. 以上


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


  3. a href =http://developer.android.com/training/managing-audio/index.html =nofollow noreferrer> Android文档,视频


干杯。 。!


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. I need to have ffmpeg (the best way is to use Linux, not Windows, because in Windows there are some troubles with its installation).
  2. How to play sound of video?
  3. I have read that some open-source libraries can play video without any efforts. My job is to give them byte-array or path to video on SD. Is this right?

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!

解决方案

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.

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.

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

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

Now for your questions:-

  1. As above

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

  3. Play simply by looking at Android Docs,Video

Cheers..!

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

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