开发者

RTSP Streaming Video With Android MediaPlayer

I've been trying for quite some time now to use Android's MediaPlayer to stream mp4/h-264 encoded video to my HTC Incredible (Android 2.2). However, I've been getting various error messages such as "prepare failed", "setDataSource failed", "unable to create media player", and "media server died."

I was able to stream an mp4 video and a USB webcam feed from a VLC server on my desktop to my android last week (with about 9 seconds latency), and for some reason this week it won't even load.

I'm currently using the exact same method that Android has provided in their API DEMOS regarding media, and I'm not trying to access it from an outside network. Has anybody figured out media player, or is a custom client wit开发者_StackOverflow社区h a VideoView the way to go?

Any help would be greatly appreciated

-AB


The problem with RTSP in the android is bitrate. With low bitrates, every file will work.

If you don't care about the stream being UDP, you can use HTTP stream:

  1. Install an Apache server on your pc.
  2. Move the movies to the Apache folder.
  3. Open them in android with your MediaPlayer code (http://your-pc-ip/movie.mp4).

Attention: The movie name must be *.mp4

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜