Uni造型在我的代码和vlc上工作得很好。
库的源代码在这里:https://github.com/fyhertz/libstreaming
对于多播,当前代码在启动RTSP服务器时输出如下
Transport: RTP/AVP/UDP;multicast;destination=232.0.1.2;client_port=5004-5005;server_port=56203-60523;ssrc=eacf345e;mode=play但是当我尝试使用vlc连接到rtsp时,vlc连接但没有给出任何输出(i.e:audio).i将此链接提供给vlc "rtsp://192.168.1.115:1234“。"192.168.1.115“是我的android设备服务器的ip地址。我当前的代码是:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.activity_main);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
mSurfaceView = (SurfaceView) findViewById(R.id.surface);
// Sets the port of the RTSP server to 1234
Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
editor.putString(RtspServer.KEY_PORT, String.valueOf(1234));
editor.commit();
// Configures the SessionBuilder
SessionBuilder.getInstance()
.setSurfaceView(mSurfaceView)
.setPreviewOrientation(90)
.setContext(getApplicationContext())
.setAudioEncoder(SessionBuilder.AUDIO_AAC)
.setVideoEncoder(SessionBuilder.VIDEO_NONE)
.setDestination("232.0.1.2");
// Starts the RTSP server
this.startService(new Intent(this,RtspServer.class));附注:如果在android.Kindly中有其他支持多播的rtsp服务器库,请务必推荐。
发布于 2016-11-05 00:53:44
也许太晚了,但这里有一些信息,也许会有帮助
libstreaming是一个openSource库,所以如果你进一步查看一些代码,会话需要一些参数(查询),所以可能这就是为什么你没有关于VLC的原因。尝试使用"rtsp://192.168.1.115:1234?camera=back“进行测试。默认功能不接受空查询。
希望这能有所帮助
问候
https://stackoverflow.com/questions/31261283
复制相似问题