-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.x] Janus pp rec doesn't fill gaps in audio file #2990
Comments
janus-pp-rec hasn't changed between |
@techwipes what are you doing to mute the sound ? |
I didn’t quite understand the question, I didn’t update the converter, I work only with the Janus branch itself. I wrote my own service for working with files processed by janus-pp-rec. Before switching to 1.0.x, everything worked fine. After the update, the file names changed a little and the timestamps in the file names began to differ, after refactoring I noticed that there was an out of sync between sound and audio, and began to look for the problem. |
Hi Alessandro! I just asked my frontend colleagues, they answer me: |
You're renegotiating the PeerConnection, which when audio is added back will cause the SSRC to change. As a consequence, the recorder will fix the RTP headers to make the change in sequence number and timestamp seamless, thus making it look like there was no pause. If you just want to mute audio, there are easier and less invasive ways of doing that, like locally muting the audio track (which will result in sending silence). |
Thanks for the advice! |
When muting locally there's no message, it's up to you to circulate an event out of band. |
Much appreciate, closing the issue |
@lminiero The local mute method worked, the problem went away. |
Please don't take this as an insult, I just want to understand and help We wrote about this situation in the google group here I wrote earlier that gaps are not filled during post-processing if we have audio stream renegotiations |
The light will stay on for audio as well, on the tab. You can try using replaceTrack(null) to stop sending, and close the previous track to release the resources; a new getUserMedia to get the audio/video track again can be used for another replaceTrack to restore the stream without a renegotiation. On the picture you shared, that's probably because or the SSRC change I mentioned, and if so is a consequence of the change that was contributed in #2724 that I probably forgot about when I answered that post. Since a renegotiation will change the SSRC after it's removed and re-added, when the existing recorder calls Not sure if/how this should be addressed, since I don't like the idea of always creating a new recording file after a renegotiation, since it depends on what triggered a recording in the first place. If we're recording everything it's one thing, if it's per participant maybe another. I'll give this some thought to see if I can come up with a workable solution. |
Actually it may not even be as easy as that, since the Janus core itself calls |
I just checked with the EchoTest and I see timestamps have the proper gaps when renegotiating a stream out and then back in: I removed video in a renegotiation, and after ~18s added it back in, and from the timestamps in the MJR file I see a |
Hi Lorenzo! Thank you for your reply. I have only one problem left, this is the filling the gaps in the video file when the camera is turned off. I would like the camera indicator to turn off when the video stream is muted, and this can be done if you send a renegotiation for the stream. But in the file after conversion using the Janus utility, instead of a black frame, the last frame is inserted for the entire duration of the pause. And in the video, the situation looks like the participant is frozen, and did not turn off the camera. What should happen when you disable and enable video in the current version? Should the pause be filled with a black frame as before, or should the last frame be inserted? I recorded a video to make it easier to understand me d230496d-e4c6-11ec-8fd9-0242ac140005.mp4) |
The frozen frame is what you should expect, because unlike audio we can't generate a black frame (video works in a different way). If you keep track of renegotiations in a metadata file, you can generate a new video out of the recording by adding the black video yourself. |
Thanks, it's all clear now |
Notice that you can also try to generate a black screen from the client side, using a canvas element and replaceTrack: this way, when you want to mute video you can stop the webcam and put the canvas video in without renegotiating. Not sure how robust or reliable that would be, but it might work and keep things simpler. We have a couple of demos on how to use a canvas to feed a PeerConnection. |
What version of Janus is this happening on?
v 1.0.1
Have you tested a more recent version of Janus too?
Yes, it worked on version 0.12.1
Was this working before?
Janus pp rec fills gaps (muted audio) in audio file
Is there a gdb or libasan trace of the issue?
No
Additional context
Hi Lorenzo and the Meetecho team! I seem to have found a bug in the janus pp-rec converter.
How to produce:
Current behavior:
After conversion, you will get a 10 second audio file without the 5 second silence in the middle of the file.
Expected behavior:
After conversion, you will receive an audio file (duration 15 sec, 5 sec silence in the middle)
The text was updated successfully, but these errors were encountered: