美文网首页
Cesium实现视频影像融合

Cesium实现视频影像融合

作者: 韩无仙 | 来源:发表于2021-04-21 11:25 被阅读0次

视频影像融合

cesium中可以将video标签作为材质赋予实体,实体贴地后会覆盖模型表面,达到视频影像融合的效果。
html video标签所支持的视频文件编码格式如下

  • MP4 MPEG 4文件使用 H264 视频编解码器和AAC音频编解码器
  • WebM WebM 文件使用 VP8 视频编解码器和 Vorbis 音频编解码器
  • Ogg Ogg 文件使用 Theora 视频编解码器和 Vorbis音频编解码器
    若视频源不符合编码格式要求,需要进行视频格式转换。播放时控制video标签暂停播放可控制贴地材质的暂停播放。
<video ref="video" autoplay loop crossorigin controls style="display: none">
      <source
        src="https://cesium.com/public/SandcastleSampleData/big-buck-bunny_trailer.mp4"
        type="video/mp4"
      />
    </video>
addVideo() {
      let videoElement = this.$refs.video;
      this.viewer.showRenderLoopErrors = false;
      this.viewer.shouldAnimate = true;
      this.viewer.entities.add({
        polygon: {
          hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights([
            113.2321,
            23.1172,
            5,
            113.2315,
            23.1172,
            5,
            113.2315,
            23.1178,
            5,
            113.2321,
            23.1178,
            5,
          ]),
          material: videoElement, // 将材质设置为video元素
          clampToGround: true,
        },
      });
    },

展示效果:


image.png

全景摄像头数据接入

相关文章

网友评论

      本文标题:Cesium实现视频影像融合

      本文链接:https://www.haomeiwen.com/subject/ekealltx.html