Giter Site home page Giter Site logo

Comments (10)

BlackHole1 avatar BlackHole1 commented on July 17, 2024

长度为0是 chrome 录制 webm 的问题,目前 chrome 不认为这是一个bug,故没有修复,不过可以对 webm 进行 ffmpeg 二次转码就可以解决这个问题。

不过大小为 4kb,确实有点问题。可以提供你的测试demo repo以及你的录制地址么,我在本地进行复现。

from rebirth.

subdance avatar subdance commented on July 17, 2024

@BlackHole1
https://github.com/subdance/rebirth-master
仓库地址,只是如issue中更改了injected.ts的内容并重新build。

from rebirth.

BlackHole1 avatar BlackHole1 commented on July 17, 2024

@subdance 要录制的地址是随便都行是么

from rebirth.

subdance avatar subdance commented on July 17, 2024

@BlackHole1 就用你rebirth demo的地址吧,我当时用的就是这个

from rebirth.

BlackHole1 avatar BlackHole1 commented on July 17, 2024

你是在本地直接运行的么?还是说打包成一个docker镜像,在docker里进行运行

from rebirth.

subdance avatar subdance commented on July 17, 2024

@BlackHole1 在docker里运行的。

from rebirth.

BlackHole1 avatar BlackHole1 commented on July 17, 2024

那我是否可以理解成,你的docker 运行代码为:

Dockerfile:

FROM alo7docker/rebirth

docker-compose.yml:

version: '3'
services:
  test_rebirth:
    build: .
    container_name: test_rebirth
    ports:
     - "9223"
     - "5920"
    volumes:
      - ./rebirth_data/video:/root/Downloads
      - ./rebirth_data/logs:/etc/www/logs
      - ./src/extensions_dist:/etc/www/extensions_dist
    environment:
      MATERIAL_URL: "https://www.bugs.cc/self_page/github/rebirth/webm2mp4/"
      START_VNC: "yes"

from rebirth.

BlackHole1 avatar BlackHole1 commented on July 17, 2024

知道原因了,因为 rebirth 在开始录制的时候,其实会打开一个空白的网站。而这个空白的网站也会被注入 JavaScript 代码。
而你添加的自动录制的代码,并没有判断当前的网站是否是你想要录制的网站,导致录制了空白的页面,而 webm 其实有一个特性,就是当网页没有发生任何变化的时候,会被压缩成一帧,导致最终的视频只有4kb的大小。没有进度条的原因之前已经说明过,这里就不再阐述了。

解决方案:
在你添加的代码上,加上一个判断。如:

if (location.host !== "127.0.0.1") {
  (window as MyWindow & typeof globalThis).rebirth.start();
  setTimeout(function() {
    (window as MyWindow & typeof globalThis).rebirth.stop('testing file');
  }, 1000 * 60);
}

而其实 rebirth 会有一个检测网站是否正常加载的机制,所以,你需要在网站加载完成后,主动调用: rebirth.init()。否则网站将会在 5 分钟后,自动关闭,并把任务标记为失败。

所以最终的代码为:

if (location.host !== "127.0.0.1") {
  (window as MyWindow & typeof globalThis).rebirth.init();
  (window as MyWindow & typeof globalThis).rebirth.start();
  setTimeout(function() {
    (window as MyWindow & typeof globalThis).rebirth.stop('testing file');
  }, 1000 * 60);
}

from rebirth.

subdance avatar subdance commented on July 17, 2024

@BlackHole1
想接着请教一下,现在我要录制一个含有几分钟静止页面的网站,录制出来的webm视频时间很短,在出现静止页面的时候就结束了。这是因为webm把静止帧压缩为一帧的原因吗?如果是,有办法让webm不压缩禁止帧吗?

from rebirth.

BlackHole1 avatar BlackHole1 commented on July 17, 2024

你的猜测是对的。不过这个暂时没有办法,你可以在页面的下方设置一个每秒刷新的时间戳,然后在最终录制出来的视频中,使用ffmpeg来把下方的区域剪裁掉。

from rebirth.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.