Mkv file is not started to writen until "stopRecording" was called


Hello Team,

We are trying to use licode version 5(pre-v5.1) upgraded from version 2 and we have a question about recording.

On licode v2, mkv file was started to writen on server very soon after “startRecording” was called.
And keep adding buffered data to existing mkv file until “stopRecording” was called or stream was removed.

But on licode v5, mkv file was not created until “stopRecording” was called.
And we think this is cause of our two problems.

  • When we record long time, it take many time for mkv file was completed.
  • When stream was removed without calling “stopRecording”, mkv file was not created.

We want to have mkv files after stopRecording was called or stream was removed, as soon as possible.

Could you let me know how can I let mkv files written while recording.

Thank you.


Hello Team,

We checked Licode version 4 of recording .
And we got same result as version 2, we got mkv files very soon after “startRecording” was called.

We hope it will be same on version 5.

Thank you.


We checked git sorce and found licode/erizo/src/erizo/media/ExternalOutput.cpp was modified 3 month ago,
can this be cause of recording behavior changed?
If yes, do you have any plans to fix it?

Thank you.


I have the same question about recording APIs and hope Licode team will fix this problem.

Thank you very much!


This is my solution to this issue:

I would greatly appreciate it if the Licode team kindly give me some feedback, thank you very much!


I would like to thank you for your suggesting a solution.
I merged your comittment into licode(pre-v5.2) we are using.
And we got the result almost we expected!

But one problem is remained.
When we removed the stream without calling “stop recording”,
mkv file was created but it was not complete.
The last several tens of seconds were not recorded.

It seemed buffured data was not written when stream removed.

On the other hand when “stop recording” was called all recording data was written.
It was perfect.

Since it is several test results, there is a possibility such as our merge mistake,
don’t you have same situation?
I would appreciate any comment.

Thank you.


We found ExternalOutput::close is not called when stream has removed since pre-v5.1.
We think it’s defferent problem, so we will make new topic.
Your solution was great help for us.
Thanks a lot!