2***@qq.com
2***@qq.com
  • 发布:2023-11-24 15:29
  • 更新:2023-11-24 21:12
  • 阅读:290

使用 plus.video.LivePusher 创建 视频推流后开启预览,人脸会被拉伸

分类:uni-app

pusherInit() {

    if (this.isUserFirst) {  
      this.isFace = true  
    }  
    //获取当前窗口对象  
    const currentWebview = this.$mp.page.$getAppWebview();  
    console.log('大大阿达是的')  
    //创建视频推流对象,url是视频上传到的服务器地址,不填表示不传视频  
    this.pusher = new plus.video.LivePusher('livepusher', {  
      url: '',  
      top: '200px',  
      left: '530px',  
      width: '256px',  
      height: '155px',  
      position: 'absolute',  
      aspect: '3:4',  
      'min-bitrate': 500,  
      'z-index': 999,  
      beauty: 1,  
      whiteness: 3,  
      framerate: 15,  
      mode: 'FHD'  
    });  
    console.log('this.pusher', this.pusher)  
    currentWebview.append(this.pusher);  
    // 翻转摄像头  
    this.pusher.switchCamera()  
    //视频预览  
    setTimeout(() => {  
            this.pusher.preview();  
    },1)  

这个是什么问题呀,人脸会被拉伸

2023-11-24 15:29 负责人:无 分享
已邀请:
HRK

HRK - 一位热爱uniapp的小少年^v^

我记得以前也有出现过这个问题,修改了aspect微调一下应该就可以了

  • 2***@qq.com (作者)

    调了,怎么调都没有用,会有一点点改变,但是还是拉伸的

    2023-11-30 10:27

  • HRK

    回复 2***@qq.com: 我记得以前这个bug已经修复了,现在不知道为什么突然又复现了,重新编辑一下帖子以bug的形式提交吧,建议临时先用原生重新写livepushser,

    但是需要注意的是:存在预览画面不一致和截图会崩溃的情况,不适合人脸识别。

    2023-11-30 17:29

要回复问题请先登录注册