网络:一个百兆交换机,只接Darwin服务器,win客户端,Linux 推流端
1,运行DarwinStreamServer
2,使用FFMPEG 推流20路,片子为720P 4Mbps恒定码流,UDP TCP推流参数可改
[root@localhost 03_Tools]# cat auto_streaming.sh
IP='1.1.1.2'
PORT='554'
VideoDir='/home/svn.chunli/1.1.1.2/Streaming_Media_New_Tech/03_Tools/03_各种分辨率的各种码流_测试视频/01_Nigel_Stanford_Cymatics'
ffmpeg='/home/ffmpeg/ffmpeg/bin/ffmpeg'
Pusher()
{
#ffmpeg_flags='-c copy -rtsp_transport tcp -f rtsp'
ffmpeg_flags='-c copy -rtsp_transport udp -f rtsp'
#ffmpeg_flags='-c copy -strict -2 -c:a opus -b:a 200K -rtsp_transport tcp -f rtsp'
#ffmpeg_flags='-vn -strict -2 -c:a opus -b:a 200K -rtsp_transport tcp -f rtsp'
FileName=$1;
SdpName=$2;
cmd="${ffmpeg} -re -i ${FileName} ${ffmpeg_flags} rtsp://$IP:$PORT/${SdpName}"
ps -ef > pusher.log
grep ${SdpName} pusher.log 2>&1 > /dev/null
if [ $? -ne 0 ]
then
$cmd &
fi
sleep 1
}
while true
do
#Pusher ${VideoDir}/1920x1080/Nigel_Stanford_Cymatics_1080_4Mbits.mp4 1080_4Mbits.sdp
#Pusher ${VideoDir}/1920x1080/Nigel_Stanford_Cymatics_1080_8Mbits.mp4 1080_8Mbits.sdp
#Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_2Mbits.mp4 720_2Mbits.sdp
#Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits.sdp
#Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_8Mbits.mp4 720_8Mbits.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_1.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_2.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_3.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_4.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_5.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_6.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_7.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_8.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_9.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_10.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_11.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_12.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_13.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_14.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_15.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_16.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_17.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_18.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_19.sdp
Pusher ${VideoDir}/1280x720/Nigel_Stanford_Cymatics_720_4Mbits.mp4 720_4Mbits_20.sdp
done
[root@localhost 03_Tools]#
win VLC 拉流端
TCP模式拉流
cd C:\Program Files\VideoLAN\VLC & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_1.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_2.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_3.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_4.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_5.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_6.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_7.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_8.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_9.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_10.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_11.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_12.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_13.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_14.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_15.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_16.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_17.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_18.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_19.sdp & choice /t 1% /d y /n >nul
start /b vlc --rtsp-tcp rtsp://1.1.1.2/720_4Mbits_20.sdp & choice /t 1% /d y /n >nul
UDP模式拉流
cd C:\Program Files\VideoLAN\VLC & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_1.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_2.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_3.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_4.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_5.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_6.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_7.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_8.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_9.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_10.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_11.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_12.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_13.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_14.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_15.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_16.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_17.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_18.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_19.sdp & choice /t 1% /d y /n >nul
start /b vlc --no-rtsp-tcp rtsp://1.1.1.2/720_4Mbits_20.sdp & choice /t 1% /d y /n >nul
720_2M.20路UDP推流20路TCP拉流.jpg
720_2M.20路UDP推流20路UDP拉流.jpg
Darwin服务器压力.png
推流端网卡速率.png
观测过程中,VLC 打开RTSP流媒体,首屏会花屏。
很少很少马赛克,画质相当好。