mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-21 15:20:00 +01:00
Example script OSC peer2peer
This commit is contained in:
29
rsc/osc/vimix_connect.sh
Normal file
29
rsc/osc/vimix_connect.sh
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "Usage: "
|
||||||
|
echo $0 "<IP address> [PORT]"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$2" ]
|
||||||
|
then
|
||||||
|
PORT=9000
|
||||||
|
else
|
||||||
|
PORT=$2
|
||||||
|
fi
|
||||||
|
|
||||||
|
## 1. request to vimix
|
||||||
|
## Requires liblo-tools to be installed (Linux: apt install liblo-tools, OSX: brew install liblo)
|
||||||
|
oscsend $1 7000 /vimix/peertopeer/request i "$PORT"
|
||||||
|
|
||||||
|
## 2. start gstreamer client
|
||||||
|
## Requires gstreamer to be installed (Linux: apt install gstreamer1.0-tools, OSX: brew install gstreamer)
|
||||||
|
gst-launch-1.0 udpsrc port="$PORT" caps="application/x-rtp,media=(string)video,encoding-name=(string)JPEG" ! rtpjpegdepay ! queue ! decodebin ! videoconvert ! autovideosink sync=false
|
||||||
|
|
||||||
|
## if vimix is configured for H246 peer to peer, use this command instead:
|
||||||
|
## gst-launch-1.0 udpsrc port=9000 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" ! queue ! rtph264depay ! h264parse ! decodebin ! videoconvert ! autovideosink sync=false
|
||||||
|
|
||||||
|
## 3. disconnect from vimix
|
||||||
|
oscsend $1 7000 /vimix/peertopeer/disconnect i "$PORT"
|
||||||
|
|
||||||
@@ -1025,7 +1025,9 @@ void Control::receiveStreamAttribute(const std::string &attribute,
|
|||||||
// remove prevous identical stream
|
// remove prevous identical stream
|
||||||
Streaming::manager().removeStream(sender, port);
|
Streaming::manager().removeStream(sender, port);
|
||||||
// add the requested stream to manager
|
// add the requested stream to manager
|
||||||
Streaming::manager().addStream(sender, port, label == nullptr ? sender : label);
|
std::string clientname = label == nullptr ? sender.substr(0, sender.find_last_of(":")) : label;
|
||||||
|
clientname += " [" + std::to_string(port) + "]";
|
||||||
|
Streaming::manager().addStream(sender, port, clientname);
|
||||||
}
|
}
|
||||||
// Stream disconnection request /vimix/stream/disconnect
|
// Stream disconnection request /vimix/stream/disconnect
|
||||||
else if ( attribute.compare(OSC_STREAM_DISCONNECT) == 0 ) {
|
else if ( attribute.compare(OSC_STREAM_DISCONNECT) == 0 ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user