Evo i par primera, prvi je za strimovanje USB kamere putem RTSP protokola:
Zatim strimovanje putem HTTP protokola:
Code:
root@ox:~/videonadzor# cat start-rtsp.sh
#!/bin/sh
# Kill VLC
ps ax | grep -i vlc | awk '{print $1}' | xargs kill -9
rm nohup.out
# Stream webcam 1
nohup /usr/bin/cvlc -vvv v4l2:///dev/video0 --sout-rtsp-user="username" --sout-rtsp-pwd="password" --sout="#transcode{vcodec=h264,venc=x264{no-cabac,level=12,vbv-maxrate=384,vbv-bufsize=1000,keyint=75,ref=3,bframes=0},vb=384,scale=1,width=640,height=480,acodec=none}:rtp{sdp=rtsp://:15000/0.sdp}" &
# Stream webcam 2
nohup /usr/bin/cvlc -vvv v4l2:///dev/video1 --sout-rtsp-user="username" --sout-rtsp-pwd="password" --sout="#transcode{vcodec=h264,venc=x264{no-cabac,level=12,vbv-maxrate=384,vbv-bufsize=1000,keyint=75,ref=3,bframes=0},vb=384,scale=1,width=640,height=480,acodec=none}:rtp{sdp=rtsp://:16000/0.sdp}" &
# Exit
exit
Zatim strimovanje putem HTTP protokola:
Code:
root@ox:~/videonadzor# cat start-http-1.sh
#!/bin/sh
# Stream webcam
nohup /usr/bin/cvlc -v v4l2:///dev/video0 --sout-http-user="username" --sout-http-pwd="password" --network-caching=1500 --http-host="192.168.xxx.xxx" --sout="#transcode{vcodec=MPEG4,width=800,height=600,scale=1}:http{dst=192.168.xxx.xxx:15000/stream.ogg}" &
# Exit
exit
“If you think you are too small to make a difference, try sleeping with a mosquito.” - Dalai Lama XIV