Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
webpage_recorder
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
胡斌
7 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
69907a419c9da42a2e465be60c17a9781526d24c
69907a41
1 parent
b974f8d9
support record audio using input device virtual-audio-capturer
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
14 行增加
和
5 行删除
README.md
main.js
test.bat
README.md
查看文件 @
69907a4
webpage_recorder:利用elecron离屏渲染网页,把抓取的页面图像通过pipe传递给ffmpeg,利用ffmpeg编码成视频
环境要求:npm, electron,ffmpeg
环境要求:npm, electron,ffmpeg
,virtual-video-capturer(可以从https://sourceforge.net/projects/virtualaudiodev/files/下载)
安装:
npm install
运行命令示例:
;record duration 30s framerate 20fps width 640 height 320 videobitrate 800k
electron . -u http://182.92.9.182:9090/media/hlsPlayer/hlsPlayer.html -d 30 -f 20 -w 640 -h 320 -b 800k test.mp4
electron . -u http://182.92.9.182:9090/media/hlsPlayer/hlsPlayer.html -d 30 -f 20 -w 640 -h 320 -b 800k test.flv
ffmpeg -i test.flv -acodec copy -vcodec copy test.mp4
局限:
1.
electron需要在桌面环境下运行
2.
捕获视频间隔不够均匀
3.
还不能捕获声音
...
...
main.js
查看文件 @
69907a4
...
...
@@ -109,6 +109,12 @@ function startFFmpeg(videosize) {
args
.
push
(
'-r'
);
args
.
push
(
argv
.
f
);
args
.
push
.
apply
(
args
,
[
'-i'
,
'pipe:0'
]
);
// /*
args
.
push
(
'-f'
);
args
.
push
(
'dshow'
);
args
.
push
(
'-i'
);
args
.
push
(
'audio=virtual-audio-capturer'
);
//*/
args
.
push
(
'-vf'
)
args
.
push
(
'fps=fps='
+
argv
.
f
)
args
.
push
(
'-c:v'
);
...
...
@@ -117,7 +123,9 @@ function startFFmpeg(videosize) {
args
.
push
(
argv
.
b
);
args
.
push
(
'-r:v'
);
args
.
push
(
argv
.
f
);
args
.
push
(
'-an'
);
args
.
push
(
'-acodec'
);
args
.
push
(
'aac'
);
args
.
push
(
argv
.
_
[
0
]);
console
.
log
(
args
.
join
`
`
);
...
...
test.bat
查看文件 @
69907a4
;record duration 30s framerate 20fps width 640 height 320 videobitrate 800k
electron . -u http://182.92.9.182:9090/media/hlsPlayer/hlsPlayer.html -d 30 -f 20 -w 640 -h 320 -b 800k test.mp4
electron . -u http://182.92.9.182:9090/media/hlsPlayer/hlsPlayer.html -d 30 -f 20 -w 640 -h 320 -b 800k test.flv
ffmpeg -i test.flv -vcodec copy -acodec copy test.mp4
...
...
请
注册
或
登录
后发表评论