【问题标题】:puppeteer-recorder: Cannot call write after a stream was destroyedpuppeteer-recorder:流被销毁后无法调用 write
【发布时间】:2020-04-14 18:03:30
【问题描述】:

我使用 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

如何解决错误(流被销毁后无法调用write)?

【问题讨论】:

    标签: node.js


    【解决方案1】:

    解决了。

    重新安装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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-11
      • 2021-11-23
      • 1970-01-01
      • 1970-01-01
      • 2014-04-02
      • 1970-01-01
      • 1970-01-01
      • 2014-12-16
      相关资源
      最近更新 更多