Object VideoDecoder.getFrameData() 返回NULL?
发布于 4 年前 作者 zhaoyong 315 次浏览 来自 官方Issues

场景:在本地选择视频,想要获得视频每帧数据,通过getFrameData()调用时返回null

机型:OPPO A11X

代码:

  wx.chooseVideo({
            sourceType: ['album'],
            success(res) {
              let path = res.tempFilePath;
              let video = wx.createVideoDecoder()
              console.log(video)
              video.on('start'(v) => {
                video.seek(0);
                console.log("frameData1", video.getFrameData())
              })
              video.on('seek'(e) => {
                console.log("seek===========", e.position);
                console.log("frameData", video.getFrameData())
              })
              video.on('stop'() => console.log(2))
              video.start({source: path, mode: 0})
              setTimeout(() => video.seek(1), 1000);
              setTimeout(() => video.seek(2), 1000);
              setTimeout(() => video.seek(3), 1000);
            }
          })
回到顶部