docker-srs,rtmp服务、推送 本文共有3886个字,关键词: 使用docker部署rtmp服务器 docker-compose.yaml ``` version: "3" # 没有自定义网络就不配 networks: mbsnet: external: true services: srs-srv: #开机自启 restart: always #指定镜像 image: registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5 #指定容器hostname hostname: srs-srv #容器名称 container_name: srs-srv #创建容器后默认执行的命令 privileged: true #容器的映射端口 ports: - 1935:1935 - 1985:1985 - 1986:8080 #volumes: #- /root/https.pfx:/root/https.pfx #- /etc/localtime:/etc/localtime:ro #- ./admin/upload:/app/wwwroot/upload #- ./Configuration:/app/Configuration #- ./AppConfig.json /app/AppConfig.json:ro #environment: # - ASPNETCORE_ENVIRONMENT=Production # - ASPNETCORE_URLS=https://+443;http://+80 # - ASPNETCORE_HTTPS_PORT=44360 # - ASPNETCORE_Kestrel__Certificates__Default__Password=123456 # - ASPNETCORE_Kestrel__Certificates__Default__Path=/root/https.pfx networks: mbsnet: ipv4_address: 172.16.0.210 ``` push-mp4.yam ``` version: "3" # 没有自定义网络就不配 networks: mbsnet: external: true services: srs-srv: #开机自启 restart: always #指定镜像 image: registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5 #指定容器hostname hostname: srs-srv #容器名称 container_name: srs-srv #创建容器后默认执行的命令 privileged: true #容器的映射端口 ports: - 1935:1935 - 1985:1985 - 1986:1986 volumes: #- /root/https.pfx:/root/https.pfx #- /etc/localtime:/etc/localtime:ro #- ./admin/upload:/app/wwwroot/upload #- ./Configuration:/app/Configuration #- ./AppConfig.json /app/AppConfig.json:ro #environment: # - ASPNETCORE_ENVIRONMENT=Production # - ASPNETCORE_URLS=https://+443;http://+80 # - ASPNETCORE_HTTPS_PORT=44360 # - ASPNETCORE_Kestrel__Certificates__Default__Password=123456 # - ASPNETCORE_Kestrel__Certificates__Default__Path=/root/https.pfx networks: mbsnet: ipv4_address: 172.16.0.210 ``` 其它命令备份 ``` docker run --rm -itd \ -v /data/docker-compose/srs/mp4:/source \ registry.cn-hangzhou.aliyuncs.com/ossrs/srs:encoder \ bash -c "ffmpeg -stream_loop -1 -re -i /source/01.mp4 -c:v libx264 -preset veryfast -maxrate 3000k -bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ar 44100 -ac 2 -f flv rtmp://172.16.0.1/live/livestream" "ffmpeg -stream_loop -1 -re -i /source/01.mp4 -c:a copy -c:v libx264 -preset veryfast -crf 20 -metadata:s:v rotate=90 -f flv rtmp://172.16.0.1/live/livestream" ffmpeg -stream_loop -1 -re -i E:\带货视频\每日打卡.mp4 -c:a copy -c:v libx264 -preset veryfast -crf 20 -metadata:s:v rotate=90 -f flv rtmp://vxlife.com/live/livestream ffmpeg -i /source/01.mp4 -vf "transpose=2" /source/01-left.mp4 在这个例子中,transpose=1表示顺时针旋转90度。如果你想逆时针旋转90度,使用transpose=2 bash -c "ffmpeg -stream_loop -1 -re -i /source/01.mp4 -c copy -f mp4 rtmp://172.16.0.1/live/r1" E:\带货视频\每日打卡.mp4 bash -c "ffmpeg -stream_loop -1 -re -i /source/01.mp4 -c:v libx264 -preset veryfast -maxrate 3000k -bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ar 44100 -ac 2 -f flv rtmp://172.16.0.1/live/r1" bash -c "ffmpeg -stream_loop -1 -re -i /source/01.mp4 -c copy -f flv rtmp://172.16.0.1/live/r1" bash -c "ffmpeg -stream_loop -1 -re -i /source/01.mp4 -c copy -f mp4 rtmp://172.16.0.1/live/r1" ffmpeg -re -i /source/01.mp4 -c:v libx264 -preset veryfast -maxrate 3000k -bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ar 44100 -ac 2 -f flv flv rtmp://172.16.0.1/live/r1 ffmpeg -stream_loop -1 -re -i E:\带货视频\每日打卡.mp4 -c copy -f flv rtmp://vxlife.com/live/r1 ``` 「一键投喂 软糖/蛋糕/布丁/牛奶/冰阔乐!」 赞赏 × 梦白沙 (๑>ڡ<)☆谢谢老板~ 1元 2元 5元 10元 50元 任意金额 2元 使用微信扫描二维码完成支付 版权声明:本文为作者原创,如需转载须联系作者本人同意,未经作者本人同意不得擅自转载。 ubuntu系统,随手发现,Docker 2024-07-18 评论 159 次浏览