Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kurento WebRTC not recording

I'm trying to record video using the Kurento Media Server with nodejs. I've been running hello-world example here. I connected a recorderEndpoint to the webrtcEndpoint and was able to get the whole thing running but I receive this error message on the server:

0:37:59.122469563 7003 0xaf5500 ERROR KurentoMediaPipelineImpl /build/buildd/kms-core-5.0.3/src/server/implementation/objects/MediaPipelineImpl.cpp:32:busMessage: Error on bus: error message: 0x7f11c0330ea0, time 99:99:99.999999999, seq-num 514729, element 'kmsrecorderendpoint10', GstMessageError, gerror=(GError)NULL, debug=(string)"/build/buildd/kms-elements-5.0.3/src/gst-plugins/kmsrecorderendpoint.c(876):\ sink_required_cb\ ():\ /GstPipeline:pipeline8/KmsRecorderEndpoint:kmsrecorderendpoint10";

I don't think its recording properly, but I'm not sure what's wrong. I was able to run the original example so the server is fine.

Code here:

https://gist.github.com/poliu2s/2cd3fc2a5dc929062481

like image 336
poliu2s Avatar asked Oct 05 '14 03:10

poliu2s


1 Answers

You need to fix several issues before having your code running properly. I've created a fork of your code and I've added some modifications that you'd need to include for being able to record the WebRTC stream. The fork is here. In addition, let me provide you a few comments:

  1. The example you have chosen (the 'Hello World') cannot be stopped (it doesn't have a 'stop' button in the GUI). Hence, you won't be able to stop the recording. You should use a more advanced example having "start" and "stop" buttons so that you can stop the recording to be able to access the stored media and view it. Probably you should use better the Magic Mirror Tutorial as your stating point because it uses WebSockets for signaling and it enables you to stop the recording.
  2. You should avoid race conditions. In you code, you're using a 'recorderEndpoint' rariable which have a race condition because it's initialized in a callback and used on a different callback, being both callbacks executing in paralell and being both subject to have race conditions.

Edit: The example indeed has a stop button that, when pressed, releases the pipeline and, with that, stops the recording. Hence, comment 1 is nor really applicable.

like image 72
lulop Avatar answered Oct 04 '22 08:10

lulop