Android Dev - 第 3 方媒体播放器 SDK 或其他选项?

标签 android video android-ndk video-streaming decoding

我正在为我经常访问的多媒体网站编写应用程序,但遇到了一个问题。

After grabbing a video stream URL (h264 wrapped in an mp4 container) and attempting to play it with the native video player, it fails.

这是在我的 Moto Droid 上运行 2.2 (BB) 和 2.3 (CM7)。我已经在我的 Xoom(3.1 股票) 上测试了该应用程序,它运行良好。

我还有一个 friend 在她的 Xperia Arc(据我所知是 2.3 库存)上测试过它并且对她有效。让我认为这是一个硬件解码器问题,因为我可以使用 RockPlayer 的软件解码器 正常播放流,但不能使用硬件解码器。

所以我想知道三件事:

  1. Does the native Android player support software decoding. if so, how do I tell if it's using hardware or software and is it possible to toggle?
  2. are there any 3rd part media players with readily available SDKs (free).
  3. How can I just open the video in another app like Rock Player since I know it works. When I download a video using the browser, it asks me what video player I want it to use. How can I get this to pop up within my app and then send the video to it?

最佳答案

  1. 是的,Android 提供软件 h264 解码器,但在 2.2 中可能不可用。您可以更喜欢软件编解码器,请参阅 stagefright 的 AOSP 源代码:

    usage: stagefright [options] [input_filename] … -s(oftware) prefer software codec …

  2. ffmpeg 在 Android 上有许多衍生品和包装器,它们在各种许可限制下可用。

  3. 启动针对特定应用的 Intent 非常容易。您可以使用 setComponent()以完全匹配您需要的 Activity 。处理该问题的更好和更灵活的方法是创建一个自定义选择器(参见例如 Custom filtering of intent chooser based on installed Android package name ),让用户决定她/他喜欢哪个播放器。使用自定义选择器,您可以决定隐藏一些注册到 Action 的处理程序(例如,不使用 Android 3.0 以下版本的系统播放器)。

关于Android Dev - 第 3 方媒体播放器 SDK 或其他选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6303893/

相关文章:

java - 服务 onCreate 和 onStartCommand 不运行

Android:打开相机并获取C级别的原始数据

android - 大 .a 文件未在 android 中链接

android - 找不到 com.android.support :appcompat-v7:27. 1.1

Android - 在更新 SDK 版本 23 后添加至少一个带有 ACTION-VIEW Intent 过滤器的 Activity

android - 我可以获取我创建的服务类的实例吗

audio - 将音频添加到 ffmpeg 视频流

android - 在 LibGDX 的纹理上渲染视频

video - 如何在给定时间使用 ffmpeg 为视频提取 1 个屏幕截图?

android - 使用 Android NDK 工具链构建 SpiderMonkey