环境配置:[
环境配置问题:
环境配置分为两个部分:
- 安装ffnvcodec
结合自己的cuda driver版本去github上下载对应的版本 make + make install - ffmpeg安装:
下载ffmpeg项目源码,在其文件夹中运行 ./configure
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-ffmpeg --enable-ffplay --enable-ffprobe --enable-ffserver --enable-libx264 --enable-nvenc --enable-cuda --enable-cuvid --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
然后编译 sudo make + sudo make install
打开流媒体服务器easydarwin
进行推流
该命令可以将一个视频推20路rtsp流
在其中-rtsp_transport tcp 设置实效
且采取gpu进行编解码同时在本机上只能同时跑两条命令,多的会终止
ffmpeg -re -stream_loop -1 -hwaccel cuvid -vcodec h264_cuvid -i east_mod.mp4 -vcodec h264_nvenc -map 0 -f tee '[f=rtsp]rtsp://localhost/east5 | [f=rtsp]rtsp://localhost/east1 | [f=rtsp]rtsp://localhost/east2 | [f=rtsp]rtsp://localhost/east3 | [f=rtsp]rtsp://localhost/east4 | [f=rtsp]rtsp://localhost/east6| [f=rtsp]rtsp://localhost/east7| [f=rtsp]rtsp://localhost/east8| [f=rtsp]rtsp://localhost/east9| [f=rtsp]rtsp://localhost/east10| [f=rtsp]rtsp://localhost/east11 | [f=rtsp]rtsp://localhost/east12 | [f=rtsp]rtsp://localhost/east13 | [f=rtsp]rtsp://localhost/east14 | [f=rtsp]rtsp://localhost/east15 | [f=rtsp]rtsp://localhost/east16| [f=rtsp]rtsp://localhost/east17| [f=rtsp]rtsp://localhost/east18| [f=rtsp]rtsp://localhost/east19| [f=rtsp]rtsp://localhost/east20'
查看推流情况
查看显卡使用情况
nvidia-smi