-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsendlowdelay.sh
executable file
·40 lines (34 loc) · 1.29 KB
/
sendlowdelay.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
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# Send video (Webcam) with low delay (local preview)
WEBCAM_DEV="/dev/video0"
WEBCAM_WIDTH=704
WEBCAM_HEIGHT=576
WEBCAM_FPS=10
SERVER_IP=$1
SEND_UDP_PORT=5000
BITRATE=2000000
gst-launch -tv --gst-debug-level=2 \
v4l2src device=$WEBCAM_DEV \
! queue ! videoscale method=1 ! video/x-raw-yuv,width=\(int\)$WEBCAM_WIDTH,height=\(int\)$WEBCAM_HEIGHT \
! queue ! videorate ! video/x-raw-yuv,framerate=\(fraction\)$WEBCAM_FPS/1 \
! queue ! ffenc_mjpeg bitrate=$BITRATE \
! tee name="streamdisplay" \
! queue ! rtpjpegpay ! udpsink port=$SEND_UDP_PORT host=$SERVER_IP sync=true \
streamdisplay. \
! queue ! ffdec_mjpeg \
! ffmpegcolorspace ! queue ! cairotextoverlay text="Local" shaded-background=true \
! queue ! autovideosink
exit 0
# MJPEG
BITRATE=2000000
gst-launch -tv --gst-debug-level=2 \
v4l2src device=$WEBCAM_DEV \
! queue ! videoscale method=1 ! video/x-raw-yuv,width=\(int\)$WEBCAM_WIDTH,height=\(int\)$WEBCAM_HEIGHT \
! queue ! videorate ! video/x-raw-yuv,framerate=\(fraction\)$WEBCAM_FPS/1 \
! queue ! ffenc_mjpeg bitrate=$BITRATE \
! tee name="streamdisplay" \
! queue ! rtpjpegpay ! udpsink port=$SEND_UDP_PORT host=$SERVER_IP \
streamdisplay. \
! queue ! ffdec_mjpeg \
! ffmpegcolorspace ! queue ! cairotextoverlay text="Local" shaded-background=true \
! queue ! autovideosink