Android 流音频/视频无法流 rtsp 文件?
我想在网络上流媒体文件,android开发者网站说 MediaPlayer.setDataSource()
可以设置要使用的数据源(文件路径或http/rtsp URL)。 但在传输 rtsp url 文件时,我在 G1 设备和模拟器中都遇到了错误:命令 PLAYER_PREPARE
已完成,但出现错误或信息 PVMFailure 错误(1, -1)
。
有谁知道这个错误是什么,或者有人知道我在哪里可以得到错误描述 (1, -1)
的含义?
PS该代码在播放音频/视频文件或流式传输http协议sudio/视频文件时可以成功工作,但无法流式传输rtsp协议文件。安卓不支持rtsp流吗?
非常感谢。
I want to stream a media file on web, and android developer website has said that MediaPlayer.setDataSource()
can set the data source (file-path or http/rtsp URL) to use.
But I got an error in both G1 device and emulator when streaming a rtsp url file: Command PLAYER_PREPARE
completed with an error or info PVMFailure error(1, -1)
.
Does anyone know what is this error, or anyone knows where can I get the error description (1, -1)
means?
P.S. the code can work successfully when playing a audio/video file or streaming a http protocal sudio/video file, but can't stream rtsp protocal file. Is android not supported rtsp streaming?
Thanks very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我认为模拟器根本不支持视频,或者上次我检查时不支持视频(SDK 1.0 和 1.1),但失败并出现完全相同的错误。我不确定 1.5,但从你的报告来看,似乎仍然没有。
当然,我可能是错的,但在制作 beebPlayer 时,我发现直接部署到设备更容易!
I don't think the emulator supports video at all, or didn't last time I checked (SDK 1.0 and 1.1) which failed with the exact same error. I'm not sure about 1.5 but from your report it sounds like it still doesn't.
Of course, I could be wrong, but when making beebPlayer, I found it was just easier to deploy straight to the device!
不,Android 支持 RTSP 流。我已经设置了
Darwin Streaming Server
(开源 RTP/RTSP 流媒体服务器),并使用 RTSP Url 成功播放视频(在我的 ADP2 手机上,带有甜甜圈图像)。我使用的网址格式为:在服务器设置时已经提供了一些示例文件,您可以尝试播放。如果你想播放你的文件,那么你必须先提示他们。
No, Android supports RTSP streaming. I have setup
Darwin Streaming Server
(the open sourced RTP/RTSP streaming server), and successfully played a video (on my ADP2 phone with donut image) using RTSP Url. Url which I used is of the form:There have been already provided some sample files while server set up which you can try to play. If you want to play your file, then you have to hint them first.
我也面临着同样的问题。在其中一篇博客中,他们说它支持满足一组规则的 RTSP 流。我不知道哪个 RTSP url 支持所有这些规则。
所以我所做的就是编写自己的 RTSP 客户端来获取流,并将其传递给 Player。
I am also facing same problem. In one of the blog they say that it supports RTSP stream which satisfies the set of rules. I don't know which RTSP url supports all those rules.
So what I have done is I have written my own RTSP client to get the streams and I have passed it to Player.
今天我得到了一些新信息,似乎android OPENCore在流媒体方面有一些错误,更新的版本2.04已经修复了这些问题,但我找不到现在我的代码是什么版本。有人说 ChangeLog 有版本信息 (/external/opencore/ChangeLog) ,但我找不到这个 ChangeLog 文件在哪里。有谁知道这个文件在哪里以及如何更新 OPENCore 版本?谢谢
Today I got some new information, it seems that android OPENCore has some bugs in streaming, and newer version 2.04 has fixed these problems, but I can't find what version now my code is. someone said ChangeLog has version information (/external/opencore/ChangeLog) , but I can't find where this ChangeLog file is. Does anyone know where this file is and how could I update OPENCore version? Thanks