Comments (1)
step1 编译python_rtmpstream
安装ffmpeg
pip install ffmpeg
并不会在env_name/lib中下载对应的.so文件,例如libavcodec.so等,所以需要使用conda install ffmpeg
:
conda install -c conda-forge ffmpeg #安装最新版ffmpeg,成功编译版本ffmpeg=5.1.2
编译rtmp_streaming
如果系统环境中安装了ffmpeg并在系统环境目录下有libavcodec.so等文件的系统路径例如/usr/local/include/等,会优先使用系统路径下的文件进行编译,就算配置了find_library也没用,可以使用message给出编译时具体使用库的地址:
message(STATUS "AVCODEC_LIBRARY: ${AVCODEC_LIBRARY}")
message(STATUS "AVFORMAT_LIBRARY: ${AVFORMAT_LIBRARY}")
message(STATUS "AVUTIL_LIBRARY: ${AVUTIL_LIBRARY}")
message(STATUS "SWSCALE_LIBRARY: ${SWSCALE_LIBRARY}")
#可以使用cmake指令打印编译信息
mkdir build && cd build
cmake
如果系统路径安装了那些库,则会优先使用系统路径编译,但系统路径下的库版本未知编译的python包可能会报flv格式以及音频格式未知等问题导致推流失败:
[INFO] frame_to_text...
[INFO] warm-up done, actual latency = 2.698054s
[NULL @ 0x7f91eacabea0] Requested output format 'flv' is not a suitable output format #视频流编解码问题
[NULL @ 0x7f91eacabea0] Requested output format '-l' is not a suitable output format #音频流编解码问题
[INFO] frame_to_text...
所以最好使用conda安装的ffmpeg所使用的库文件,在CMakeList中使用set语句可以配置库使用具体路径:
set(AVCODEC_LIBRARY "/home/nypyp/miniconda3/envs/nerfstream/lib/libavcodec.so")
set(AVFORMAT_LIBRARY "/home/nypyp/miniconda3/envs/nerfstream/lib/libavformat.so")
set(AVUTIL_LIBRARY "/home/nypyp/miniconda3/envs/nerfstream/lib/libavutil.so")
set(SWSCALE_LIBRARY "/home/nypyp/miniconda3/envs/nerfstream/lib/libswscale.so")
修改tese_stream
执行pip
后,修改tese_stream.py为播放本地文件:
cap = cv2.VideoCapture("/home/nypyp/code/srs/trunk/doc/source.flv")
安装pyaudio
sudo apt-get install portaudio19-dev python-all-dev python3-all-dev
#pyaudio pip 安装会报fatal error: portaudio.h: No such file or directory,所以需要先安装前置库
pip install pyaudio
#apt 安装报错下列软件包有未满足的依赖关系:portaudio19-dev : 依赖: libasound2-dev 但是它将不会被安装
#换conda 安装
conda install pyaudio
step2 metahuman-stream
metahuman-stream install
pip install tensorflow-gpu==2.8.0 #报错,依赖冲突
pip install tensorflow-gpu==2.8.1
docker run
非root用户启动docker
参考博客:非root用户启动docker
ERROR: Got permission denied while trying to connect to the Docker daemon socket
#解决办法:添加用户到docker组
sudo groupadd docker #添加docker组
sudo gpasswd -a username docker #将用户username添加到组
id #查看用户所在的组
newgrp docker #如果未在组中,在用户终端下使用newgrp用刷新用户组
docker 假死进程占用端口
参考博客:Cannot stop or restart a docker container
sudo systemctl restart docker.socket docker.service
docker rm -f <container id>
运行app.py出现的问题
pip install protobuf==3.20 #需要降级protobuf
websocket问题,参考issues:metahuman-stream issues
#werkzeug mismatcher websocket问题
#python/site-packages/werkzeug/routing/matcher.py,注释websocket_mismatch = True
#修改python/site-packages/flask_sockets.py
self.url_map.add(Rule(rule, endpoint=f)) #改成
self.url_map.add(Rule(rule, endpoint=f, websocket=True))
nginx端口占用问题
lsof -i:8000
kill -9 PID
from metahuman-stream.
Related Issues (20)
- 推流后如何添加背景图 HOT 3
- 效果怎么样?有训练代码吗?
- 本地网页端输入内容,生成数字人区域无反应? HOT 1
- 修改python/site-packages/werkzeug/routing/matcher.py,注释websocket_mismatch = True HOT 6
- OSError: CUDA_HOME environment variable is not set
- OSError: CUDA_HOME environment variable is not set HOT 1
- 推流延迟问题
- 求助运行python app.py出现如下错误 HOT 2
- pyaudio调用本地麦克风流式推理能实现吗?
- 执行python app.py报错 HOT 1
- 请问声音为什么一顿一顿的 HOT 2
- 请问可以将背景透明吗? HOT 1
- installation steps ( 安装步骤) HOT 3
- vlc拉流,播放延迟的问题 HOT 1
- GPU RAM最低要求是多少,6G可用吗
- 替换成自己训练的模型报错 HOT 3
- 大佬,请问推流怎么加上身子呢? HOT 2
- win10+Anaconda环境下如何搭建
- 运行python app.py报错 HOT 3
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 metahuman-stream.