Android VideoView无法播放多播流

时间:2013-08-21 19:53:22

标签: android streaming vlc rtp

我正在尝试播放使用h264 / aac编码的流,该流通过多播从VLC传输。我在开始视频视图之前设置了wifi多播锁。使用从SD卡读取的SDP文件,我在启动时在LogCat中收到这些错误:

E/ASessionDescription: ASessionDescription::getServerSessionURL: Did not get the Server URL info from the control attribute...Checking in Origin Info
E/ASessionDescription: ASessionDescription::getServerURLFromOriginAndSessionName : URL info not present in the Session name
E/ASessionDescription: ASessionDescription::getServerSessionURL: Did not get the Server URL info Origin field
E/NuPlayer: getServerSessionURL for SDP Failed
这是我的sdp文件的内容:

v=0
o=- 2890844526 2890842807 IN IP4 192.168.16.1
s=Multicast stream test
c=IN IP4 239.10.1.1/127
t=0 0
a=recvonly
m=video 5004 RTP/AVP 96 97
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1
a=rtpmap:97 MPEG-4-GENERIC/44100/2
a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexltalength=3; config=1210
a=orient:portrait

所有设备都在同一网络上。这显示了代码的简单性:

VideoView videoView = (VideoView) findViewById(R.id.playback_view);
videoView.setVideoPath(Environment.getExternalStorageDirectory() + "/test.sdp");
videoView.start();

我也试过这个VLC生成的带有MP3音频的sdp,它也无法播放

v=0
o=- 15403293578011388063 15403293578011388063 IN IP4 192.168.1.2
s=Unnamed
i=N/A
c=IN IP4 239.10.1.1/255
t=0 0
a=tool:vlc 2.0.7
a=recvonly
a=type:broadcast
a=charset:UTF-8
m=audio 5004 RTP/AVP 14
b=AS:128
b=RR:0
a=rtpmap:14 MPA/90000/2
m=video 5006 RTP/AVP 96
b=AS:800
b=RR:0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=64001e;sprop-parameter-sets=Z2QAHqzZQLQnsBEAAAMAAQAAAwAyjxYtlg==,aOvssiw=;

2 个答案:

答案 0 :(得分:0)

从4.4版起,Android仍然不支持此功能。我不得不最终在这个项目中使用JavaCV。

答案 1 :(得分:-1)