-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvlc-video.sh
executable file
·28 lines (25 loc) · 982 Bytes
/
vlc-video.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
CMD=/usr/bin/cvlc
# If you need to specify the multicast interface, uncomment next line
#CMD=/usr/bin/cvlc --miface eth0
INPUT=v4l2:///dev/video0
FPS=5
OUTPUT_HEIGHT=420
STREAM_NAME="Webcam"
STREAM_DEST_IP=224.10.8.1
STREAM_DEST_PORT=5004
OUTPUT_TARGET=/dev/null
OUTPUT=:sout=#transcode\{vcodec=h264,venc=x264\{preset=ultrafast,tune=zerolatency,intra-refresh,lookahead=10,keyint=15\},fps=$FPS,scale=auto,acodec=none,scodec=none,height=$OUTPUT_HEIGHT\}:rtp\{dst=$STREAM_DEST_IP,port=$STREAM_DEST_PORT,mux=ts,sdp=sap,name=$STREAM_NAME\}
echo "Starting stream:"
echo ""
echo " video source: $INPUT"
echo " output height: $OUTPUT_HEIGHT"
echo " fps: $FPS"
echo " stream name: $STREAM_NAME"
echo " destination: $STREAM_DEST_IP:$STREAM_DEST_PORT"
echo " stderr to: $OUTPUT_TARGET"
echo ""
echo "Clients can receive the stream, e.g., with:"
echo "cvlc rtp://@$STREAM_DEST_IP:$STREAM_DEST_PORT"
echo ""
$CMD $INPUT $OUTPUT :sout-keep 2> $OUTPUT_TARGET