지점 A에서 kurento 미디어 서버로 오디오 스트림을 보내고 gstreamer를 사용하여 지점 B에서 해당 오디오 스트림을 수신하려고합니다. 나는 무엇을 성취하려고합니까?gstreamer를 사용하는 kurento 미디어 서버의 오디오 스트림을 청취하십시오.
(포인트 A) ---- GSTREAMER가있는 오디오 스트림 보내기 ---> (음악) ---- 오디오 스트림 -----> (포인트 B) --- GSTREMAER로 오디오를 얻으십시오 ----!
function createOutGoingAudioStream() {
var sdpOffer = " v=0\r\n"
+ "o=- 0 0 IN IP4 0.0.0.0\r\n"
+ "c=IN IP4 0.0.0.0\r\n"
+ "t=0 0\r\n"
+ "m=audio 5005 RTP/AVP 0\r\n"
+ "a=rtpmap:0 PCMU/8000\r\n";
var pipeline;
console.log();
console.log("Starting Audio Stream from Command Post.....");
// get kurento client
getKurentoClient(function(error, kurentoClient) {
if (error) {
return callback(error);
}
// create media pipe line
kurentoClient.create('MediaPipeline', function(error, pipeline) {
if (error) {
return callback(error);
}
// create first rtpEndpoint for the incoming audio stream
pipeline.create('RtpEndpoint', function(error, rtpEndpoint) {
if (error) {
pipeline.release();
return callback(error);
}
console.log('audio RTP Endpoint created successfully!');
rtpEndpoint.processOffer(sdpOffer, function(error, sdpAnswer) {
if (error) {
pipeline.release();
return callback(error);
}
console.log(sdpAnswer);
console.log();
// Start a gstreamer audio stream over the audio port that we got from the kurento server
var jsonSdpAnswer = transform.parse(sdpAnswer);
var port = jsonSdpAnswer.media[0].port;
console.log("Starting audio stream to the kurento server: ");
console.log('sh gstreamer.sh ' + port + ' > log.txt')
exec('sh gstreamer.sh ' + port + ' > log.txt', function(err, stdout, stderr) {
if (err) {
console.error(err);
return;
}
//if all is ok nothing wil prompt to the console
console.log(stdout);
});
});
// create second rtpEndpoint for the outgoing to the odroid's audio stream
pipeline.create('RtpEndpoint', function(error, outRtpEndpoint) {
if (error) {
pipeline.release();
return callback(error);
}
console.log('second RTP Endpoint created successfully!');
rtpEndpoint.connect(outRtpEndpoint, function(error){
if(error) return onError(error);
});
outRtpEndpoint.generateOffer(function(error,offerSdp){
if(error) return onError(error);
console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
console.log(offerSdp);
});
});
});
});
});
}
나는 kurento 서버 outRtpEndpoint의 sdpOffer에서 얻을 그것은 다음과 같습니다 :
지금까지 내가 코드를 넣고 쓴
sdp Offer가 무슨 상관하지 않습니다 난 그 일을 원하지 않는 그 흐름을 듣기 위해 노력하고 있습니다. 내가 도대체 뭘 잘못하고있는 겁니까 ?
정말 도움이됩니다.
감사합니다 !!!