rtsp srs 推流处理

1、docker 启动SRS

# 运行docker
docker run -it -p 1935:1935 -p 1985:1985 -p 8080:8080 registry.cn-hangzhou.aliyuncs.com/ossrs/srs:4 ./objs/srs -c conf/docker.conf

2、通过ffmpeg转流

# ffmpeg下载地址
https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-2022-12-19-git-48d5aecfc4-full_build.7z
ffmpeg.exe -re -i C:\Users\Nbad\Desktop\srs-develop\trunk\doc\source.200kbps.768x320.flv -c copy -f flv rtmp://localhost/live/livestream

3、尝试推送rtsp流

rtsp://USER:PASSWORD:554/Streaming/Channels/101
# 本地视频文件推流
ffmpeg.exe -re -i C:\Users\Nbad\Desktop\srs-develop\trunk\doc\source.200kbps.768x320.flv -c copy -f flv rtmp://localhost/live/livestream
# 资料来源https://blog.csdn.net/diyangxia/article/details/120172920
# 网络上的命令行
ffmpeg -rtsp_transport tcp -i "rtsp://admin:ajb123456@192.168.10.36" -c copy -f hls -hls_time 2.0 -hls_list_size 0 -hls_wrap 15 C:/wjanzhuang/nginx/html/hls/test.m3u8
# 本地推流处理
ffmpeg -rtsp_transport tcp -i "rtsp://USER:PASSWORD@192.168.23.2:554/Streaming/Channels/101" -c copy -f flv rtmp://localhost/live/livestream

# 摄像头视频编码需要转换成 h.264
ffmpeg -i rtsp://USER:PASSWORD@192.168.23.4:554/Streaming/Channels/101 -c copy -f flv rtmp://localhost/live/livestream

# ffplay 播放rtsp正常
ffplay.exe rtsp://USER:PASSWORD@192.168.23.4:554/Streaming/Channels/101


# h265转h264
ffmpeg -rtsp_transport tcp -i rtsp://USER:PASSWORD@192.168.23.4:554/Streaming/Channels/101 -c:v libx264 -f flv rtmp://localhost/live/livestream

ffmpeg -rtsp_transport tcp -i rtsp://USER:PASSWORD@192.168.23.2:554/Streaming/Channels/101 -c:v libx264 -f flv rtmp://localhost/live/livestream1