Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/gstreamer/gstreamer.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=GStreamer Service
After=network.target
After=network.target parallel.service

[Service]
WorkingDirectory=/home/ubuntu/Selk-Companion-Computer
Expand Down
10 changes: 10 additions & 0 deletions scripts/gstreamer/install_parallel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/bash

sudo apt install parallel

#unit file
sudo cp parallel.service /etc/systemd/system/

sudo systemctl daemon-reload
sudo systemctl enable parallel
sudo systemctl start parallel
12 changes: 12 additions & 0 deletions scripts/gstreamer/parallel.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=GStreamer Service
After=network.target

[Service]
WorkingDirectory=/home/ubuntu/Selk-Companion-Computer
Restart=on-failure
ExecStart=/bin/true
User=pi

[Install]
WantedBy=multi-user.target
11 changes: 8 additions & 3 deletions scripts/gstreamer/start_gstreamer.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/bash

gst-launch-1.0 -v v4l2src device=/dev/video3 ! video/x-h264, width=1920,height=1080! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.137.255 port=5600 sync=false
gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-h264, width=1920,height=1080! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.137.255 port=5601 sync=false
gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-h264, width=1920,height=1080! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.137.255 port=5602 sync=false
commands=(
"gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-h264, width=1920, height=1080 ! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.137.255 port=5601 sync=false"
"gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-h264, width=1920, height=1080 ! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.137.255 port=5602 sync=false"
"gst-launch-1.0 -v v4l2src device=/dev/video3 ! video/x-h264, width=1920, height=1080 ! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.137.255 port=5600 sync=false"
)

#will print output in terminal
parallel -j3 --line-buffer --tag ::: "${commands[@]}"