aboutsummaryrefslogtreecommitdiff
path: root/example-scripts/gstreamer/source-video0-as-monitor-and-cam3.sh
blob: 9d8130928f3db2ecaf8a11572ee92c0d2d443904 (plain)
  1. #!/bin/sh
  2. confdir="`dirname "$0"`/../"
  3. . $confdir/default-config.sh
  4. if [ -f $confdir/config.sh ]; then
  5. . $confdir/config.sh
  6. fi
  7. VSOURCECAPS="video/x-raw, format=I420, width=640, height=360, pixel-aspect-ratio=1/1, interlace-mode=progressive, framerate=30/1"
  8. VSOURCE="v4l2src device=/dev/video0 ! $VSOURCECAPS"
  9. VOVERLAY="clockoverlay halignment=right valignment=top time-format=\"%Y/%m/%d %H:%M:%S\""
  10. #VOVERLAY="timeoverlay halignment=right valignment=top ! clockoverlay halignment=left valignment=top time-format=\"%Y/%m/%d %H:%M:%S\""
  11. ASOURCE="audiotestsrc freq=660"
  12. LOCALWIDTH=$(cat /sys/class/graphics/fb0/virtual_size | cut -d, -f1)
  13. LOCALHEIGHT=$(cat /sys/class/graphics/fb0/virtual_size | cut -d, -f2)
  14. LOCALVCAPS="video/x-raw, width=$LOCALWIDTH, height=$LOCALHEIGHT"
  15. LOCALVTRANSFORM="videoscale ! videoconvert ! $LOCALVCAPS"
  16. LOCALVSINK="fbdevsink sync=false"
  17. REMOTEVCAPS="video/x-raw, format=I420, width=$WIDTH, height=$HEIGHT, pixel-aspect-ratio=1/1, interlace-mode=progressive, framerate=$FRAMERATE/1"
  18. REMOTEVTRANSFORM="videorate ! videoscale ! videoconvert ! $REMOTEVCAPS"
  19. REMOTEACAPS="audio/x-raw,format=S16LE,channels=$AUDIOCHANNELS,layout=interleaved,rate=$AUDIORATE"
  20. REMOTEATRANSFORM="$REMOTEACAPS"
  21. REMOTEMUX="matroskamux streamable=true"
  22. REMOTESINK="tcpclientsink host=$MIXHOST port=10002"
  23. gst-launch-1.0 \
  24. $VSOURCE !\
  25. $VOVERLAY !\
  26. tee name=videolayers \
  27. videolayers. ! queue !\
  28. $LOCALVTRANSFORM !\
  29. $LOCALVSINK \
  30. videolayers. ! queue !\
  31. $REMOTEVTRANSFORM !\
  32. remotemux. \
  33. $ASOURCE !\
  34. $REMOTEATRANSFORM !\
  35. remotemux. \
  36. $REMOTEMUX name=remotemux !\
  37. $REMOTESINK