【问题标题】:Kurento Many to Many Recording Blank VideosKurento 多对多录制空白视频
【发布时间】:2017-06-27 18:50:46
【问题描述】:

我正在尝试处理为多对多演示编写的代码,同时使用带录音演示的一对一演示作为参考。我已将以下代码添加到 UserSession.java 构造函数:

  public static final String RECORDING_PATH = "file:///recordings/";
  public static final String RECORDING_EXT = ".webm";

  public UserSession(final String name, String roomName, final WebSocketSession session, MediaPipeline pipeline) {
    this.pipeline = pipeline;
    this.name = name;
    this.session = session;
    this.roomName = roomName;

    this.outgoingMedia = new WebRtcEndpoint.Builder(pipeline).build();
    this.recorder = new RecorderEndpoint.Builder(pipeline, RECORDING_PATH + roomName + '_' + name + RECORDING_EXT).build();

    this.isRecording = false;

在传入媒体连接到会话的对等点后,我已将此添加到 getEndpointForUser 方法的底部:

sender.getOutgoingWebRtcPeer().connect(incoming);
sender.getOutgoingWebRtcPeer().connect(this.recorder);

我正在通过套接字调用从浏览器手动触发录制和停止录制,但视频文件始终为空 (0kb)。为每个会话创建正确数量的视频,它们只是没有任何数据。有谁知道我可能做错了什么?

【问题讨论】:

    标签: java webrtc kurento


    【解决方案1】:

    非常重要,RecorderEndpoint 知道正在使用什么媒体容器约束配置文件。我的问题是我在开发时关闭了前端媒体约束的音频(这很烦人)。 RecorderEndpoint 需要通过传入正确的 MediaProfileSpecType 来意识到这一点。

    this.recorder = new RecorderEndpoint.Builder(pipeline, RECORDING_PATH + roomName + '_' + name + RECORDING_EXT)
      .withMediaProfile(MediaProfileSpecType.WEBM)
      .build();
    

    只需在前端重新打开音频即可修复它,但您也可以参考其他教程中包含的代码,其中 Kurento 团队根据某种媒体约束容器逻辑连接 RecorderEndpoint,您可能需要一款制作应用程序,适用于有网络摄像头问题且音频或视频无法通过的用户。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-09
      相关资源
      最近更新 更多