问题描述
基本上是subj.我正在使用用于 JS 的 Kurento-Utils.该主题已经针对较低级别的工作进行了讨论,但是在项目的这一点上,切换方法为时已晚:(
Basically subj. I am using Kurento-Utils for JS. That topic has been discussed for the case of lower-level work, but at this point in project, it is too late to go switch approach :(
当我流式传输带有音频的网络摄像头时,它会很好地记录到 .webm 文件中.但是,我如何仅流式传输音频或视频?尝试导致文件大小为 0 且没有错误消息.
When i stream webcam with audio it is recorded nicely into a .webm file. But, how do i stream audio only, or video only? An attempt results in file being of 0 size with no error messages.
是否有任何用于演示该用例的 Kurento-utils/js 示例代码?
Is there any sample code for Kurento-utils/js which would demonstrate that use case?
推荐答案
在实例化记录器和连接元素时,您需要提供适当的MediaType
.
You need to provide the appropriate MediaType
when instantiating the recorder, and connecting the elements.
pipeline.create('RecorderEndpoint', {uri: filepath,mediaProfile:'WEBM_AUDIO_ONLY'},
function (error, recorder) {
webrtcEp.connect(recorder,'AUDIO', function (err) {
recorder.record();
console.log("recording started ...");
});
});
这篇关于除非同时存在音频和视频流,否则 Kurento WebRTC 不会录制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!