【问题标题】:How to send multicast audio in rtsp using libstreaming and recieve it in vlc player如何使用 libstreaming 在 rtsp 中发送多播音频并在 vlc 播放器中接收
【发布时间】: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


    【解决方案1】:

    也许为时已晚,但这里有一些信息可能会有所帮助

    libstreaming 是一个开源库,因此如果您进一步查看一些代码,会话需要一些参数(查询),所以也许这就是您在 VLC 上一无所有的原因。 尝试使用“rtsp://192.168.1.115:1234?camera=back”进行测试。默认功能不接受空查询。

    希望对你有帮助

    问候

    【讨论】:

      猜你喜欢
      • 2023-03-29
      • 2011-08-18
      • 1970-01-01
      • 2014-01-29
      • 2021-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多