Javascript Can';t在recordRTC中记录更高的帧率
无法使用recordRTC到webm录制高于30 fps的视频。摄像机能够以1920x1080的所需分辨率以60 fps的速度进行记录。有没有关于如何完整记录60帧的想法Javascript Can';t在recordRTC中记录更高的帧率,javascript,angular,webrtc,webm,recordrtc,Javascript,Angular,Webrtc,Webm,Recordrtc,无法使用recordRTC到webm录制高于30 fps的视频。摄像机能够以1920x1080的所需分辨率以60 fps的速度进行记录。有没有关于如何完整记录60帧的想法 var options = { mimeType: 'video/webm', video: { width: 1920, height: 1080 }, bitsPerSecond: 51200000, frameR
var options = {
mimeType: 'video/webm',
video: {
width: 1920,
height: 1080
},
bitsPerSecond: 51200000,
frameRate: 60
};
this.stream = stream;
this.recordRTC = RecordRTC(stream, options);
请试试这个:
<script src="https://cdn.webrtc-experiment.com/RecordRTC.js"></script>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<button id="btn-record">Click To Record</button>
<hr>
<video id="your-video" autoplay playsinline controls style="width: 50%; border-adius: 9px;"></video>
<script>
var recorder;
var yourVideo = document.getElementById('your-video');
document.getElementById('btn-record').onclick = function() {
this.disabled = true;
this.style.background = 'transparent';
this.style.color = 'grey';
var cameraProperties = {
video: {
width: 1920,
height: 1080
},
audio: true
};
navigator.mediaDevices.getUserMedia(cameraProperties)
.then(function(cameraStream) {
yourVideo.volume = 0;
yourVideo.srcObject = cameraStream;
recorder = RecordRTC(cameraStream, {
videoBitsPerSecond: 51200000,
mimeType: 'video/webm'
});
recorder.startRecording();
setTimeout(function() {
recorder.stopRecording(function() {
var blob = recorder.getBlob();
alert('Recording size: ' + bytesToSize(blob.size));
var videoURL = URL.createObjectURL(blob);
yourVideo.srcObject = null;
yourVideo.volume = 1;
yourVideo.src = videoURL;
});
}, 5000);
}).catch(function(error) {
console.error('Unable to capture 1080p', error);
alert('Maybe 1080p is not supported by your camera. Please check yoru console logs.');
});
};
</script>
点击录制
无功记录仪;
var yourVideo=document.getElementById('your-video');
document.getElementById('btn-record')。onclick=function(){
this.disabled=true;
this.style.background='transparent';
this.style.color='灰色';
var CameraProperty={
视频:{
宽度:1920,
身高:1080
},
音频:正确
};
navigator.mediaDevices.getUserMedia(cameraProperties)
.then(功能(cameraStream){
yourVideo.volume=0;
yourVideo.srcObject=cameraStream;
记录器=记录器RTC(cameraStream{
视频比特秒:51200000,
mimeType:“视频/webm”
});
记录器。开始记录();
setTimeout(函数(){
recorder.stopRecording(函数(){
var blob=recorder.getBlob();
警报('记录大小:'+bytesToSize(blob.size));
var videoURL=URL.createObjectURL(blob);
yourVideo.srcObject=null;
yourVideo.volume=1;
yourVideo.src=videoURL;
});
}, 5000);
}).catch(函数(错误){
控制台错误('无法捕获1080p',错误);
警报('您的相机可能不支持1080p。请检查您的主机日志');
});
};
谢谢Mauz,不幸的是,我已经能够以1080p录制,我只是尝试以60帧速率录制,我将录制选项设置为60,但输出视频仅为每秒30帧。您是否设置了{cameraProperties}。帧速率{exact:66}?很抱歉,响应太晚,但我尝试将帧速率设置为精确,然而,我看到了30fps的输出。我已经验证了我的相机可以通过OBS输出60帧/秒