在Kurento停止录制后无法再次录制

时间:2017-07-12 08:37:38

标签: webrtc kurento

我正在研究这个Kurento应用程序,我面临一个奇怪的问题,一旦我开始录制视频并停止录制,我就无法再次开始录制。事件发送到服务器但似乎没有发生任何事情! PFB代码:

names = ["John", "Sam", "Sandy", "Andrew", "Charlie"]

s_names = names.grep(/^s/i)
# or
s_names = names.select{ |name| name.downcase.start_with?('s') }

s_names.each do |name|
  puts "'#{name}' starts with an 'S'"
end
# 'Sam' starts with an 'S'
# 'Sandy' starts with an 'S'

在我点击录制按钮的屏幕上,服务器上的功能是:

room.pipeline.create('WebRtcEndpoint', function (error, outgoingMedia) {        
    if (error) {
        console.error('no participant in room');
        // no participants in room yet release pipeline
        if (Object.keys(room.participants).length == 0) {
            room.pipeline.release();
        }
        return callback(error);
    }
    outgoingMedia.setMaxVideoRecvBandwidth(256);
    userSession.outgoingMedia = outgoingMedia;

    // add ice candidate the get sent before endpoint is established
    var iceCandidateQueue = userSession.iceCandidateQueue[socket.id];
    if (iceCandidateQueue) {
        while (iceCandidateQueue.length) {
            var message = iceCandidateQueue.shift();
            console.error('user : ' + userSession.id + ' collect candidate for outgoing media');
            userSession.outgoingMedia.addIceCandidate(message.candidate);
        }
    }

    userSession.outgoingMedia.on('OnIceCandidate', function (event) {
        console.log("generate outgoing candidate : " + userSession.id);
        var candidate = kurento.register.complexTypes.IceCandidate(event.candidate);
        userSession.sendMessage({
            id: 'iceCandidate',
            sessionId: userSession.id,
            candidate: candidate
        });
    });

    // notify other user that new user is joining
    var usersInRoom = room.participants;
    var data = {
        id: 'newParticipantArrived',
        new_user_id: userSession.id,
        receiveVid: receiveVid
    };

    // notify existing user
    for (var i in usersInRoom) {
        usersInRoom[i].sendMessage(data);
    }

    var existingUserIds = [];
    for (var i in room.participants) {
        existingUserIds.push({id: usersInRoom[i].id, receiveVid: usersInRoom[i].receiveVid});
    }
    // send list of current user in the room to current participant
    userSession.sendMessage({
        id: 'existingParticipants',
        data: existingUserIds,
        roomName: room.name,
        receiveVid: receiveVid
    });

    // register user to room
    room.participants[userSession.id] = userSession;

    var recorderParams = {
        mediaProfile: 'WEBM',
        uri: "file:///tmp/Room_"+room.name+"_file"+userSession.id +".webm"
    };

    //make recorder endpoint
    room.pipeline.create('RecorderEndpoint', recorderParams, function(error, recorderEndpoint){
        userSession.outgoingMedia.recorderEndpoint = recorderEndpoint;
        outgoingMedia.connect(recorderEndpoint);
    });

事情是,它第一次正确记录,即在服务器上创建的文件以及正确记录的视频和音频。 当我按停止停止录制时,会看到预期的效果,即录制停止。

现在,当我再次按下录制时,不会制作视频文件。事件正确到达服务器(console.log表示如此)

任何人都可以帮我吗?!

感谢。

0 个答案:

没有答案