寻求在AAC流在Android [英] Seeking in AAC streams on Android

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

问题描述

我是从一个HTTP服务器收到一个AAC流,并将它作为数据源的的MediaPlayer Android中。
它可以播放完全正常,但是当我尝试执行 mediaPlayer.seekTo(INT位置)我得到一万次以下错误:
WARN / AACDe codeR(13889):AAC德codeR返回错误-1,代沉默
 WARN / AACDe codeR(13889):AAC德codeR返回错误10,代替沉默
 WARN / AACDe codeR(13889):AAC德codeR返回错误1,代沉默

I'm getting an AAC stream from a HTTP server and using that as the datasource for the MediaPlayer in Android.
It plays perfectly fine, but when I try to execute mediaPlayer.seekTo(int position) I get the following errors about a million times:
WARN/AACDecoder(13889): AAC decoder returned error -1, substituting silence
WARN/AACDecoder(13889): AAC decoder returned error 10, substituting silence
WARN/AACDecoder(13889): AAC decoder returned error 1, substituting silence

在Android 2.2出现该错误,但它似乎并没有在早期版本擦出火花。 支持寻求的是在我的应用程序必须的,我想它的工作为Android 1.5 - 2.2。

This error happens on Android 2.2 but it does not seem to work on earlier versions either. Support for seeking is a must in my application, and I would like it to work for Android 1.5 - 2.2.

有没有关于如何在AAC流求什么好的解决办法?

Is there any good solution on how to seek in AAC streams?

推荐答案

您不能寻求服务流。如何可以在服务器处理呢?

You cannot seek a served stream. How could the server handle this?

即使您保存的字节数,原始的AAC流是非可查找(它们不包含任何寻求信息)。一些媒体播放器围绕这每次加载时间解析上飞的整个文件和索引它。一个更好的解决办法是重新打包流放入容器,如MP4。下面是使用一个例子 MP4Box

Even if you save the bytes, raw AAC streams are non-seekable (they contain no seek information). Some media players get around this by parsing the whole file and indexing it on the fly every time they load it. A better solution is to repackage the stream into a container, like MP4. Here's an example using MP4Box:

MP4Box -add raw_stream.aac -new output_file.mp4

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

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