record-camera-and-screen/README.md

37 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 使用Python3基于FFmpeg实现的录制摄像头和屏幕录制
### 1. 运行环境和所需组件
1. [Python3](https://www.python.org/downloads)
2. 安装依赖组件,-i是代理地址使用代理下载速度会加快一点
```python
pip install -r requirements.txt -i https://pypi.douban.com/simple
```
3. 录制屏幕需要下载[Screen Capture Recorder](https://sourceforge.net/projects/screencapturer/)
4. 安装编译工具cx_Freeze如果需要
```python
pip install cx_freeze
```
5. 下载安装打包工具[Inno Setup](http://www.jrsoftware.org/isinfo.php)(如果需要打包)。
### 2. 在命令行下运行
```python
python recordwindow.py
#Win10-64系统稳定运行其他系统暂未测试。
```
### 3. 设置
参考设置如下:
* 摄像头名称USB2.0 HD UVC WebCam
* 声音输入设备:麦克风 (Realtek High Definition Audio)
* 屏幕录制设备screen-capture-recorder
* 系统声音设备virtual-audio-capturer
不同机器和设备名称有所不同。
### 4. 编译
```
python csetup.py build
#默认编译的可执行文件生成在目录D:\dev\record\record-win
#参照csetup.py修改编译信息
```
### 5. 打包
用Inno setup打开setup.iss文件修改必要信息然后编译执行。
### 6. 开发总结
[请参见总结文章](https://segmentfault.com/a/1190000015409826)