I have a shell script that runs on my mac (./go), it opens a ssh session on a raspberry pi then runs a script which streams video from the raspberry pi to a UDP port on the mac.

I also need the mac to run a receive script (./tsplay) so it can view the streamed video.

The problem is that I have tried to use the command open -a Terminal.app ./tsplay before the SSH session is started, a new terminal window opens but it doesn't wait for stream data to come in and it exits - [Process completed]


source network.conf

rm remote.conf

if [ "$1" != "" ] 
  sed "s/FRAMERATE=25/FRAMERATE=$1/" video.conf > remote.conf
  cp video.conf remote.conf

open -a Terminal.app ./tsplay 

echo "###### Network Settings ######" >> remote.conf
echo export TCPPORT=$TCPPORT >> remote.conf
echo export UDPPORT=$UDPPORT >> remote.conf
echo export RX_IP=$RX_IP >> remote.conf
echo export NOW=\"`date +%F" "%T`\" >> remote.conf

#echo exit >> remote.conf

chmod +x remote.conf

echo Copy script to $TX_IP
scp remote.conf $USER@$TX_IP:/home/pi

echo Run Script
ssh $USER@$TX_IP ./ustream
ssh $USER@$TX_IP

1 Answer 1


Why do you want to run tsplay in a Terminal anyway? Surely it is a graphical app if it displays video? Why not do a sleep for a while to let the Pi start sending and then start tsplay to receive?

(sleep 5; ./tsplay ) &
  • Thanks for the reply. The ./go script finishes with ssh $USER@$TX_IP ./ustream . that starts the video sending pipeline which needs to stay open while streaming, as does the ./tsplay which i also need to open at the same time (or a few seconds after)
    – PaulHam
    Feb 13, 2015 at 23:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .