【发布时间】:2015-07-07 06:27:49
【问题描述】:
Uni cast 与我的代码和 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 连接但不提供任何输出(即:音频)。我将此链接提供给 vlc“rtsp://192.168.1.115:1234”。 “192.168.1.115”是我的安卓设备服务器的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中还有其他带有多播的rtsp SERVER库。请建议。
【问题讨论】:
标签: android android-studio vlc libstreaming