hughfenghen / hughfenghen.github.io

blog
https://hughfenghen.github.io/
44 stars 2 forks source link

Failed to execute 'configure' on 'VideoEncoder': The provided resolution has a coded area which exceeds the maximum coded area (414720) #110

Open hughfenghen opened 2 years ago

hughfenghen commented 2 years ago

配置 videoEncoder

videoEncoder.configure({
    codec: 'avc1.42E01E',
    width: 1280,
    height: 720,
    //...
  })

报错

Uncaught DOMException: Failed to execute 'configure' on 'VideoEncoder': The provided resolution (1280x720) has a coded area (1280*720=921600) which exceeds the maximum coded area (414720) supported by the AVC level (3.0) indicated by the codec string (0x1E). You must either specify a lower resolution or higher AVC level.

于是顺带学习了一下 mimeCodec 的含义
image

解决方法:参数改成 codec: 'avc1.42E01F' 就好了。