我使用puppeteer-recorder,代码是:
await record({
browser: browser,
page: page,
output: '8output.webm',
fps: 8,
frames: 8 * 10,
prepare: function (browser, page) {},
render: function (browser, page, frame) {}
});
但运行错误:
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
at doWrite (_stream_writable.js:413:19)
at writeOrBuffer (_stream_writable.js:401:5)
at Socket.Writable.write (_stream_writable.js:301:11)
at /data/pupp_test/node_modules/puppeteer-recorder/index.js:72:12
at new Promise (<anonymous>)
at write (/data/pupp_test/node_modules/puppeteer-recorder/index.js:71:3)
at module.exports.record (/data/pupp_test/node_modules/puppeteer-recorder/index.js:44:11)
at processTicksAndRejections (internal/process/task_queues.js:82:5)
at async /data/pupp_test/test2.js:22:5
我的ffmpeg配置为“ --enable-libvpx --enable-libvorbis”
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --enable-libvpx --enable-libvorbis
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
Hyper fast Audio and Video encoder
如何解决错误(流被破坏后无法调用写操作)?
解决了。
重新安装libvpx。请参阅https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
./configure --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm
make
make install
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句