我正在尝试播放使用h264/aac编码并通过多播从VLC传输的流。我在启动视频视图之前设置了wifi多播锁定。使用从SD卡读取SDP文件,我在logcat中在启动时得到这些错误: Android VideoView无法播放多播流
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产生的SDP与MP3音频,它也无法播放
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=;
你的答案应该更有建设性。这个问题解释了它试图“播放用h264编码的流”,所以_“mp3编解码器”似乎不适用。 – konus