简体   繁体   English

有没有办法在Android API中播放原始音频/视频流?

[英]Is There a Way to Playback Raw Audio/Video Streams in Android API's?

I have a Vorbis stream that I can decode to PCM if necessary, and I have a raw h264 stream all three of which are supported by Android when in a container. 我有一个Vorbis流,可以在必要时将其解码为PCM,并且有一个原始的h264流,在容器中时,Android都支持这三个流。 Wondering if there is any way to manually feed video and audio samples into the android MediaPlayer without any container. 想知道是否有任何方法可以在没有任何容器的情况下将视频和音频样本手动输入到android MediaPlayer中。 I would imagine I would have to override methods within the MediaPlayer. 我想我将不得不重写MediaPlayer中的方法。 Does anyone have experience with this or have an easier way to do this? 有没有人有经验或有更简单的方法来做到这一点? I can't imagine its impossible... 我无法想象这是不可能的...

You may be able to play the audio pcm samples (For that also, I guess you may have to put a wav header) but you may not be able to play the H264 elementary stream without a container. 您可能可以播放音频pcm样本(为此,我想您可能也必须放置wav标头),但是如果没有容器,您可能无法播放H264基本流。 In the media framework (Stagefright), there are sniffers functions registered for various container formats which could tell what kind of parser need to be used and then extractor(parser) is created. 在媒体框架(Stagefright)中,有针对各种容器格式注册的嗅探器功能,它们可以告诉需要使用哪种解析器,然后创建extractor(parser)。 I don't think that you will be able to play the H264 elementary stream from the application using the inbuilt media framework of Android. 我认为您将无法使用Android的内置媒体框架从应用程序播放H264基本流。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM