我正在使用MediaRecorder API和Canvas captureStream方法在浏览器中编码画布的VP8视频流.此数据通过二进制Web套接字发送到FFmpeg.
var outputCaptureStream = $('canvas')[0].captureStream(30);
var mediaRecoder = new MediaRecoder(outputCaptureStream,{
mimeType: 'video/webm'
});
mediaRecorder.ondataavailable = function (e) {
ffmpegStdin.write(e.data);
}
mediaRecoder.start(1000);
出于某种原因,流似乎随机切换到较低分辨率的中间流. FFmpeg对此不满意:
Input stream #0:0 frame changed from size:1280×720 fmt:yuv420p to size:1024×576 fmt:yuv420p
[vp8 @ 0x2a02c00] Upscaling is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs,it means that your file has a feature which has not been implemented.
[vp8 @ 0x2a02c00] If you want to help,upload a sample of this file to 07002 and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
我怀疑它与cpu使用率过高有关,并且Firefox试图通过缩小视频来提供帮助.我的问题:
> Firefox是否会动态缩小视频?
>如果是这样,导致这种情况发生的原因是什么? (cpu负载?流背压?)
>是否可以阻止Firefox这样做?
>我对这种行为有不同的解释吗?
最佳答案
原文链接:https://www.f2er.com/js/428971.html