Open kazepis opened 9 months ago
A difference that was noticed was the reported muxer:
Openvidu v2.26.0 / Kurento 6
created with GStreamer matroskamux version 1.8.1.1 / GStreamer Matroska muxer
Openvidu v2.27.0 - v2.29.0 / Kurento 7.0.1
created with GStreamer matroskamux version 1.16.3 / GStreamer Matroska muxer
Good morning everybody! Has anyone seen this and if so were you able to reproduce?
Hello @kazepis, You previously stated that your deployment is this:
docker run -p 4443:4443 --rm \
-e OPENVIDU_SECRET=MY_SECRET \
-e OPENVIDU_RECORDING=true \
-e OPENVIDU_RECORDING_PATH=/opt/openvidu/recordings \
-v /var/run/docker.sock:/var/run/docker.sock \
-v C:/OpenViduRecordings:/opt/openvidu/recordings \
openvidu/openvidu-dev:2.29.0
Is this the only way of deployment? Or do you have a production environment?
If you have a production environment, which edition is it? CE, PRO, or ENTERPRISE.
@j1elo has a suggestion which is to change a Kurento configuration value, specifically gapsFix=GENPTS
. But to give you instructions on how to configure Kurento, we need to know what types of deployment you have, as the way to change the configuration may vary.
Hi, I was looking at this today.
Seeing this output from mkvalidator:
ERR201: Invalid 'Colour' for profile 'webm' in Video at 348
ERR201: Invalid 'Range' for profile 'webm' in Colour at 365
ERR201: Invalid 'MatrixCoefficients' for profile 'webm' in Colour at 365
ERR201: Invalid 'TransferCharacteristics' for profile 'webm' in Colour at 365
ERR201: Invalid 'Primaries' for profile 'webm' in Colour at 365
and guided by your suggestion to look into the GStreamer matroskamux component, I've found an awfully similar bug report in the issue tracker of GStreamer (i.e. the 3rd-party library that actually handles media within Kurento):
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2526
I cannot do much right now regarding this, but at least I confirmed the issue so GStreamer devs see that it affects more people. As a workaround, I'm thinking that Kurento has a couple ways to deal with packet loss wrt. recording; the default is to leave missing pieces of video/audio as gaps in the file, but another option is to enable the "GENPTS" GapsFix method, which attempts to fix timestamps and provide a smooth playback in web browsers.
This recording mode is enabled by editing a Kurento config file: RecorderEndpoint.conf.ini. It's however not been exposed as part of the OpenVidu API, so depending on your deployment, editing such file can be more or less cumbersome.
There is a Kurento guide to deal with config file modifications in Docker environments: https://doc-kurento.readthedocs.io/en/latest/user/faq.html#faq-docker
but probably it's better to follow the more specific help that @cruizba can offer in this regard.
Thank you both @cruizba and @j1elo. I was able to repro the problem both when on my dev laptop on windows 10 (with docker desktop and the docker run command that @cruizba is quoting) AND when trying with the on-premise "production" env which has a CE version deployed on a VM with Ubuntu Server LTS 22.04.3. I tried all versions of Openvidu from 2.27 to 2.29 and they all seem to have the same problem with the recorded videos.
I am more than confident that I will be able to perform any trials if you give me sufficient instructions. I will be able to attach to a running docker container and change configuration. Just tell me how to "reload" the changed configuration.
Thank you very much for your time and effort and I remain at your disposal.
@cruizba and @j1elo I tried what you suggested but the problem remains the same. I edited the docker_compose.yml to expose the kurento config to local disc by adding the following line in the volume section of kms container:
- /opt/openvidu/kurento-config:/etc/kurento/modules/kurento
Then I copied all the contents of /etc/kurento/modules/kurento
to local disc using the command docker cp openvidu-kms-1:/etc/kurento/modules/kurento/ /opt/openvidu/kurento-config/
I edited the RecorderEndpoint.conf.ini
to perform the change you proposed:
root@openvidu2:/opt/openvidu/kurento-config# cat RecorderEndpoint.conf.ini
;; How to fix gaps when they are found in the recorded stream.
;;
;; Gaps are typically caused by packet loss in the input streams, such as when
;; an RTP or WebRTC media flow suffers from network congestion and some packets
;; don't arrive at the media server.
;;
;; Possible values:
;;
;; * NONE: Do not fix gaps.
;;
;; Leave the stream as-is, and store it with any gaps that the stream might
;; have. Some players are clever enough to adapt to this during playback, so
;; that the gaps are reduced to a minimum and no problems are perceived by the
;; user; other players are not so sophisticated, and will struggle trying to
;; decode a file that contains gaps. For example, trying to play such a file
;; directly with Chrome will cause lipsync issues (audio and video will fall
;; out of sync).
;;
;; This is the best choice if you need consistent durations across multiple
;; simultaneous recordings, or if you are anyway going to post-process the
;; recordings (e.g. with an extra FFmpeg step).
;;
;; * GENPTS: Adjust timestamps to generate a smooth progression over all frames.
;;
;; This technique rewrites the timestamp of all frames, so that gaps are
;; suppressed. It provides the best playback experience for recordings that
;; need to be played as-is (i.e. they won't be post-processed). However,
;; fixing timestamps might cause a change in the total duration of a file. So
;; different recordings from the same session might end up with slightly
;; different durations.
;;
;; Default: NONE.
;;
gapsFix=GENPTS
root@openvidu2:/opt/openvidu/kurento-config#
I restarted openvidu with ./openvidu restart
and recorded a new video call.
However, the playback is still halted on Chrome and the matroska validator still complains:
C:\OpenViduRecordings>mkvalidator --no-warn str_CAM_VQtf_con_IPivS72avr.webm
ERR201: Invalid 'Colour' for profile 'webm' in Video at 348
ERR201: Invalid 'Range' for profile 'webm' in Colour at 365
ERR201: Invalid 'MatrixCoefficients' for profile 'webm' in Colour at 365
ERR201: Invalid 'TransferCharacteristics' for profile 'webm' in Colour at 365
ERR201: Invalid 'Primaries' for profile 'webm' in Colour at 365
ERR0B1: SimpleBlock at 4360 track #2 is not a keyframe
ERR0B1: SimpleBlock at 5510 track #2 is not a keyframe
ERR0B1: SimpleBlock at 5575 track #2 is not a keyframe
...
...
truncated
...
...
ERR0B1: SimpleBlock at 11504170 track #2 is not a keyframe
ERR0B1: SimpleBlock at 11508164 track #2 is not a keyframe
file "str_CAM_VQtf_con_IPivS72avr.webm"
created with GStreamer matroskamux version 1.16.3 / GStreamer Matroska muxer
C:\OpenViduRecordings>
Is there any way I can try to use the latest gstreamer in the kurento container to see if the problem is fixed?
Hello everyone! I am facing same issue on kms7. Any updates on this? or any alternative solution would be highly appreciated.
Hello everyone! I am facing same issue on kms7. Any updates on this? or any alternative solution would be highly appreciated.
I haven't been able to find a workaround. I am stuck with Openvidu 2.26 which is the last one that is working.
Describe the bug Videos recorded via openvidu recording API starting from openvidu v2.27.0 are corrupted and cause problems to chromium based browsers.
Expected behavior When validating a recorded video using the mkvalidator tool, the tool should not report a problem. e.g. with openvidu v2.26.0 and older:
Wrong current behavior When you check a recorded video with the mkvalidator tool it reports many errors. e.g.: with openvidu version v2.27.0 - v2.29.0 (include major kurento update to 7.0.1)
OpenVidu tutorial where to replicate the error Use default openvidu recording tutorial for node: https://docs.openvidu.io/en/stable/tutorials/openvidu-recording-node/ to record a video and then inspect the video using the mkvalidator tool:
OpenVidu deployment info Docker container as explained in tutorial https://docs.openvidu.io/en/stable/tutorials/openvidu-recording-node/
Cannot test with this one because i cannot get the recording file
Client device info (if applicable) Describe the client device(s) or platform(s) where you are able to replicate the error. For example:
Additional context The above corrupted video seems to be affecting chromium based browser because when I try to play it back using this html code:
I get this error:![image](https://github.com/OpenVidu/openvidu/assets/6062370/26f20fd9-9ce2-4af4-8a31-879cefab1f9e)
After the error, any attempt to seek to a timestamp does not trigger the
canplaythrough
event ANY MORE.I remain at your disposal for any more information you may need.