如何在小容器中显示高分辨率的网络摄像头

How to display webcam with high resolution in a small container

我将我的网络摄像头显示到 html5 视频标签中,如下所示:

<video id="myWebCamVideo" muted autoplay></video>

网络摄像头分辨率为 1920x1080 像素。关键是我想显示如下:

<div id="divVideo" class="col-lg-4 col-md-4 mt-3 text-center ml-auto mr-auto">
      <video id="myWebCamVideo" muted autoplay></video>
</div>

但是视频标签比 col-lg-4 大。是否可以在较小的 div 中显示带有高清的视频标签?或者视频标签总是需要选择像素?

亲切的问候

             <div id="divVideo" class="col-lg-4 col-md-4 mt-3 text-center ml-auto mr-auto">
                    <video id="myWebCamVideo" muted autoplay style="width: 100%;">
                    </video>
             </div>

为视频标签提供 100% 的宽度。它将根据父 div 宽度设置。

希望对您有所帮助。