Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- netcat -l 5001 | mplayer -fps 30 -cache 1024 - 2>&1 &
- raspivid -fps 25 -w 640 -h 480 -t 0 -o - | nc 192.168.0.1 5001
- #/bin/bash
- PORT=51718
- if [ "$#" -eq 1 ]
- then
- PORT=$1
- fi
- while [ true ]
- do
- echo "Starting Video Server on port $PORT"
- IP_AND_PORT=$(nc -l $PORT)
- echo "Streaming to $IP_AND_PORT"
- raspivid -fps 25 -w 640 -h 480 -t 0 -o - | nc $IP_AND_PORT
- echo "Stream terminated"
- done
- #!/bin/bash
- if [ "$#" -ne 3 ]
- then
- echo " usage: client.sh pi_ip pi_video_server_port pi_video_stream_port"
- echo "example: client.sh 192.168.0.2 51718 5001"
- exit 1
- fi
- OWN_IP=$(ip route get 8.8.8.8 | head -1 | cut -d' ' -f8)
- PI_IP=$1
- PI_VIDEO_SERVER_PORT=$2
- PI_VIDEO_STREAM_PORT=$3
- echo "requesting stream to $OWN_IP:$PI_VIDEO_STREAM_PORT"
- # start mplayer which waits for a stream from the pi
- nc -l $PI_VIDEO_STREAM_PORT | mplayer -fps 30 -cache 1024 - 2>&1 &
- echo "$OWN_IP $PI_VIDEO_STREAM_PORT" | nc $PI_IP $PI_VIDEO_SERVER_PORT
- while [ true ]
- do
- sleep 1s;
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement