Problems trying to play RTSP stream from VLC in Android
Posted: 26 Apr 2009 19:53
Hi,
I posted this to one of the Android dev groups and I thought it would be a good idea to put it here as well. Thanks for any info...
------------
For the last few days I've been trying to play an RTSP stream on the
physical device (dev phone) from an instance of VLC (0.9.9) running on
my machine, but I've had no success.
I started with some mp4 video files that I verified will play off the
SD card on the device. I took one of these files and published an
RTSP stream from an instance of a VLC server running on my laptop.
Here's the output string in VLC that is used to create the stream from
the base mp4:
:sout=#transcode
{vcodec=mp4v,vb=200,scale=1,acodec=mp4a,ab=16,channels=2}:duplicate
{dst=display,dst=rtp{dst=,mux=ts,port=1234,sdp=rtsp://
192.168.1.100:1234/stream.sdp}}
Which corresponds to:
Video codec - MPEG-4
Audio codec - AAC
Video bitrate - 200 kbps
Audio bitrate - 16 kbps
Resolution - 320x240
I can publish this stream in the VLC server and consume it from a VLC
player (running on the same machine as the server or from another
machine on the network) without any problems by simply telling it to
play the stream at this address:
rtsp://192.168.1.100:1234/stream.sdp
The problem I'm having is trying to play this same stream from the
device. I'm using the 1.1 release of the SDK, and the project I'm
using to test this is the ApiDemos project
(MediaPlayerDemo_Video.java). All I'm doing is setting the "path"
variable in code to the rtsp:// link above. When this line executes:
mMediaPlayer.prepare();
This exception is thrown:
java.io.IOException: Prepare failed.: status=0xFFFFFFFF
So it's not clear to me what exactly the failure is. I've tried
tinkering with the VLC output a million different ways, but I can't
get around this error. I've tried using several different mp4 source
files and even some wmv's.
I'm by no means an expert in streaming video protocols, but it seems
that VLC may not be able to produce an RTSP stream that Android is
able to recognize, and that's really what I'm looking for an answer
to. I'm hoping someone has been able to take an mp4 file (or a source
file of any video format, really) and, in VLC, transcode it and make
it available in an RTSP stream that the device is able to play back.
I've read some other posts that are semi-related to the RTSP issues
I'm seeing here, but I don't think I've seen anything yet where
someone confirmed outright that they were able to play an RTSP stream
from VLC to Android. I'm going to post this in the VideoLAN forums as
well. Any help is appreciated. Thanks.
I posted this to one of the Android dev groups and I thought it would be a good idea to put it here as well. Thanks for any info...
------------
For the last few days I've been trying to play an RTSP stream on the
physical device (dev phone) from an instance of VLC (0.9.9) running on
my machine, but I've had no success.
I started with some mp4 video files that I verified will play off the
SD card on the device. I took one of these files and published an
RTSP stream from an instance of a VLC server running on my laptop.
Here's the output string in VLC that is used to create the stream from
the base mp4:
:sout=#transcode
{vcodec=mp4v,vb=200,scale=1,acodec=mp4a,ab=16,channels=2}:duplicate
{dst=display,dst=rtp{dst=,mux=ts,port=1234,sdp=rtsp://
192.168.1.100:1234/stream.sdp}}
Which corresponds to:
Video codec - MPEG-4
Audio codec - AAC
Video bitrate - 200 kbps
Audio bitrate - 16 kbps
Resolution - 320x240
I can publish this stream in the VLC server and consume it from a VLC
player (running on the same machine as the server or from another
machine on the network) without any problems by simply telling it to
play the stream at this address:
rtsp://192.168.1.100:1234/stream.sdp
The problem I'm having is trying to play this same stream from the
device. I'm using the 1.1 release of the SDK, and the project I'm
using to test this is the ApiDemos project
(MediaPlayerDemo_Video.java). All I'm doing is setting the "path"
variable in code to the rtsp:// link above. When this line executes:
mMediaPlayer.prepare();
This exception is thrown:
java.io.IOException: Prepare failed.: status=0xFFFFFFFF
So it's not clear to me what exactly the failure is. I've tried
tinkering with the VLC output a million different ways, but I can't
get around this error. I've tried using several different mp4 source
files and even some wmv's.
I'm by no means an expert in streaming video protocols, but it seems
that VLC may not be able to produce an RTSP stream that Android is
able to recognize, and that's really what I'm looking for an answer
to. I'm hoping someone has been able to take an mp4 file (or a source
file of any video format, really) and, in VLC, transcode it and make
it available in an RTSP stream that the device is able to play back.
I've read some other posts that are semi-related to the RTSP issues
I'm seeing here, but I don't think I've seen anything yet where
someone confirmed outright that they were able to play an RTSP stream
from VLC to Android. I'm going to post this in the VideoLAN forums as
well. Any help is appreciated. Thanks.