Firefox帧速率最大限制 [英] Firefox Frame Rate Max Constraint

查看:285
本文介绍了Firefox帧速率最大限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Firefox中,当调用getUserMedia()时,我添加了一个约束来限制帧速率。但是,任何低于30fps的值都不允许在GUM权限对话框中选择网络摄像头。





例如,我已经克隆并更改了github.com/webrtc/samples的约束示例,位于 https://mikeg0.github.io/samples/src/content/peerconnection/constraints/ 。我将frameRate.min变量重命名为frameRate.max。这在Chrome浏览器中可以正常工作,但不能在Firefox中使用。



我发现这是一个bugzilla报告,但是它表示帧率限制已经实现。这是Firefox还没有理清的东西吗?是否与这个错误有关?



或者我使用这个约束不正确?

解决方案

相机发现



浏览器(甚至OS)不同意从 getUserMedia 返回哪个相机模式。



<尽管Chrome会根据您的要求重新调整尺寸和作物,但Firefox只会返回原生特定相机的模式。这两种方法都是有优势的。



这两种方法都有优势,但不幸的是它们是互相排斥的,因为如果你总是得到你想要的东西,相机。



至于你为什么没有获得低于30 fps的模式,可能是因为你的相机没有。对于Windows 7上的Firefox,我可以从罗技C920中获得各种模式,但是当我限制帧频时,我倾向于只返回相当高分辨率的模式(比如2592 x 1944 x 10fps),这可能成为我的特定模型的特征。



在OSX上,还有错误1131861 你找到了。 OSX是棘手的,因为它在操作系统级别上显示的相机有多少。目前30fps是一个人为的限制。

设置带宽限制



你真正关心的是降低对等连接的带宽需求。该规范仍在如何直接指定编码参数,比如比特率,分辨率和帧率,目前看起来像这样︰

$ $ p $ $ $ code varcode = {maxBitrate:60000,maxFramerate:5,scaleResolutionDownBy: 2};

var sender = pc.addTrack(stream.getVideoTracks()[0],stream);
sender.setParameters({encodings:[encoding]});

您可以指定多个编码同播。

这个功能在Firefox 47(Beta)中可用,其中此小提琴应该工作。


In Firefox, when calling getUserMedia(), I've added a constraint to limit the frame rate. However, any value below 30fps doesn't allow a webcam choice in the GUM permissions dialog.

For exmaple, I've cloned and changed the constraints example of github.com/webrtc/samples at https://mikeg0.github.io/samples/src/content/peerconnection/constraints/. I renamed the frameRate.min variable to frameRate.max. This works as expected in Chrome, but not in Firefox.

I found this bugzilla report, but it says frame rate constraints are implemented. Is this something Firefox has yet to sort out? Is it related to this bug?

Or am I using this constraint incorrectly?

解决方案

Camera discovery

Browsers (and even OS'es) disagree about which camera modes to return from getUserMedia.

Whereas Chrome rescales and crops to whatever you ask for, Firefox returns modes native to your specific camera(s) only. Both are within the spec.

Both approaches have advantages, but unfortunately they're mutually exclusive, since if you always get what you want then you've discovered nothing about the camera.

As to why you get no modes below 30 fps, it may be because your camera doesn't have any. For what it's worth, with Firefox on Windows 7, I get all sorts of modes from my Logitech C920, but when I limit frame rate, I tend to get back only quite high resolution modes (like 2592 x 1944 x 10fps), which may be a trait of my specific model.

On OSX there's also bug 1131861 which you found. OSX is tricky because of how little it reveals about cameras at the OS level. The 30 fps is an artificial limitation there at the moment.

Setting bandwidth limits

It sounds from your comments that your real concern is reducing bandwidth requirements of a peer connection. The spec is still working on how to specify encoding parameters like bitrate, resolution and framerate directly, which currently looks something like this:

var encoding = { maxBitrate: 60000, maxFramerate: 5, scaleResolutionDownBy: 2 };

var sender = pc.addTrack(stream.getVideoTracks()[0], stream);
sender.setParameters({ encodings: [encoding] });

You can specify more than one encoding for simulcast.

This functionality is available in Firefox 47 (Beta), where this fiddle should work.

这篇关于Firefox帧速率最大限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆