Comments (10)
长度为0是 chrome
录制 webm
的问题,目前 chrome
不认为这是一个bug,故没有修复,不过可以对 webm
进行 ffmpeg
二次转码就可以解决这个问题。
不过大小为 4kb,确实有点问题。可以提供你的测试demo repo以及你的录制地址么,我在本地进行复现。
from rebirth.
@BlackHole1
https://github.com/subdance/rebirth-master
仓库地址,只是如issue中更改了injected.ts的内容并重新build。
from rebirth.
@subdance 要录制的地址是随便都行是么
from rebirth.
@BlackHole1 就用你rebirth demo的地址吧,我当时用的就是这个
from rebirth.
你是在本地直接运行的么?还是说打包成一个docker镜像,在docker里进行运行
from rebirth.
@BlackHole1 在docker里运行的。
from rebirth.
那我是否可以理解成,你的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.
知道原因了,因为 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.
@BlackHole1
想接着请教一下,现在我要录制一个含有几分钟静止页面的网站,录制出来的webm视频时间很短,在出现静止页面的时候就结束了。这是因为webm把静止帧压缩为一帧的原因吗?如果是,有办法让webm不压缩禁止帧吗?
from rebirth.
你的猜测是对的。不过这个暂时没有办法,你可以在页面的下方设置一个每秒刷新的时间戳,然后在最终录制出来的视频中,使用ffmpeg来把下方的区域剪裁掉。
from rebirth.
Related Issues (15)
- Test Allcontributors Api Service HOT 2
- 请问extension_dist的作用是? HOT 2
- Page crashes with RESULT_CODE_INVALID_CMDLINE_URL HOT 4
- 在阿里云的容器服务里启动puppeteer启动报错 HOT 5
- vnc的连接失败, 如下图 HOT 7
- 如何远程执行录制命令 HOT 7
- 关于录制的视频质量 HOT 2
- 基于webrtc的录制权限问题 HOT 6
- "initTimeout" 问题咨询 HOT 1
- rebirth.init() 调用不生效问题 HOT 2
- 白板服务器status code返回500 HOT 3
- 录制时出现caught XIO error HOT 1
- 无法控制录制文件的编码 HOT 4
- 这个项目已经跑不起来了吗? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rebirth.