收藏
回答

Object VideoDecoder.getFrameData() 返回NULL?

场景:在本地选择视频,想要获得视频每帧数据,通过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);
            }
          })
回答关注问题邀请回答
收藏

2 个回答

  • Shuailing
    Shuailing
    06-25

    同样问题

    06-25
    有用
    回复
  • Revan
    Revan
    05-11

    遇到同样问题,有解吗?

    05-11
    有用
    回复
登录 后发表内容