首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在rtsp中使用libstreaming发送多播音频并在vlc播放器中接收

如何在rtsp中使用libstreaming发送多播音频并在vlc播放器中接收
EN

Stack Overflow用户
提问于 2015-07-07 14:27:50
回答 1查看 808关注 0票数 2

Uni造型在我的代码和vlc上工作得很好。

库的源代码在这里:https://github.com/fyhertz/libstreaming

对于多播,当前代码在启动RTSP服务器时输出如下

代码语言:javascript
复制
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地址。我当前的代码是:

代码语言:javascript
复制
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服务器库,请务必推荐。

EN

回答 1

Stack Overflow用户

发布于 2016-11-05 00:53:44

也许太晚了,但这里有一些信息,也许会有帮助

libstreaming是一个openSource库,所以如果你进一步查看一些代码,会话需要一些参数(查询),所以可能这就是为什么你没有关于VLC的原因。尝试使用"rtsp://192.168.1.115:1234?camera=back“进行测试。默认功能不接受空查询。

希望这能有所帮助

问候

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31261283

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档