Using MPlayer to Play a Video on a Wall Display

Given:

  • a wall display made of 35 displays
  • 3 display PCs (each PC drives up to 12 displays)
  • each display is configured as a separated X-Screen
  • each display PC is able to connect to another display PC over ssh without a password

Requirements:

  • mplayer
  • socat
  • ssh

Approach:

MPlayer synchronizes master and slave instances by sending UDP packages with a frame number to the port 23867. Thus, we have to configure port forwarding on each  display PC to be able to run multiple slave instances on a single PC. We use socat to achieve that.

$ socat -u UDP4-RECVFROM:23867,fork - | 
tee >(socat -u - UDP4-SENDTO:192.168.1.XXX:24800) 
>(socat -u - UDP4-SENDTO:192.168.1.XXX:24801) 
>(socat -u - uDP4-SENDTO:192.168.1.XXX:24802) 
>(socat -u - uDP4-SENDTO:192.168.1.XXX:24803) 
>(socat -u - uDP4-SENDTO:192.168.1.XXX:24804) 
>(socat -u - uDP4-SENDTO:192.168.1.XXX:24805) 
>(socat -u - uDP4-SENDTO:192.168.1.XXX:24806) 
>(socat -u - uDP4-SENDTO:192.168.1.XXX:24807) 
>(socat -u - uDP4-SENDTO:192.168.1.XXX:24808) 
>(socat -u - uDP4-SENDTO:192.168.1.XXX:24809) 
>(socat -u - uDP4-SENDTO:192.168.1.XXX:24810) 
>(socat -u - uDP4-SENDTO:192.168.1.XXX:24811) 
> /dev/null

Next we start mplayer slaves on each display PC.

$ mplayer -display :0.6 -vf crop=384:204:0:204 -noborder -geometry 1920x1080 -udp-slave -udp-port 24800 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &
$ mplayer -display :0.7 -vf crop=384:204:0:408 -noborder -geometry 1920x1080 -udp-slave -udp-port 24801 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &
$ mplayer -display :0.9 -vf crop=384:204:0:612 -noborder -geometry 1920x1080 -udp-slave -udp-port 24802 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &
$ mplayer -display :0.10 -vf crop=384:204:384:612 -noborder -geometry 1920x1080 -udp-slave -udp-port 24803 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &
$ mplayer -display :0.11 -vf crop=384:204:768:612 -noborder -geometry 1920x1080 -udp-slave -udp-port 24804 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &

We can use ssh to start mplayer slaves remotely on display PCs

$ ssh 10.20.152.32 'mplayer -display :0.4 -vf crop=384:204:384:0 -noborder -geometry 1920x1080 -udp-slave -udp-port 24800 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.32 'mplayer -display :0.1 -vf crop=384:204:768:0 -noborder -geometry 1920x1080 -udp-slave -udp-port 24801 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.32 'mplayer -display :0.9 -vf crop=384:204:1152:0 -noborder -geometry 1920x1080 -udp-slave -udp-port 24802 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.32 'mplayer -display :0.5 -vf crop=384:204:384:204 -noborder -geometry 1920x1080 -udp-slave -udp-port 24803 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.32 'mplayer -display :0.3 -vf crop=384:204:768:204 -noborder -geometry 1920x1080 -udp-slave -udp-port 24804 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.32 'mplayer -display :0.10 -vf crop=384:204:1152:204 -noborder -geometry 1920x1080 -udp-slave -udp-port 24805 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.32 'mplayer -display :0.6 -vf crop=384:204:384:408 -noborder -geometry 1920x1080 -udp-slave -udp-port 24806 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.32 'mplayer -display :0.8 -vf crop=384:204:768:408 -noborder -geometry 1920x1080 -udp-slave -udp-port 24807 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.32 'mplayer -display :0.11 -vf crop=384:204:1152:408 -noborder -geometry 1920x1080 -udp-slave -udp-port 24808 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.33 'mplayer -display :0.5 -vf crop=384:204:1536:0 -noborder -geometry 1920x1080 -udp-slave -udp-port 24800 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.33 'mplayer -display :0.6 -vf crop=384:204:1536:204 -noborder -geometry 1920x1080 -udp-slave -udp-port 24801 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.33 'mplayer -display :0.7 -vf crop=384:204:1536:408 -noborder -geometry 1920x1080 -udp-slave -udp-port 24802 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.33 'mplayer -display :0.9 -vf crop=384:204:1536:612 -noborder -geometry 1920x1080 -udp-slave -udp-port 24803 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'
$ ssh 10.20.152.33 'mplayer -display :0.10 -vf crop=384:204:1152:612 -noborder -geometry 1920x1080 -udp-slave -udp-port 24804 c01-global-home/video/Sintel.2010.1080p.mkv /dev/null 2>&1 &'

Of course, we can wrap all these commands in a single bash script.

Next, we start mplayer master instance.

$ mplayer -display :0.5 -vf crop=384:204:0:0 -noborder -geometry 1920x1080 -udp-master -udp-ip 192.168.1.255 -udp-port 23867 c01-global-home/video/Sintel.2010.1080p.mkv

Experiment: Concentration / Peripheral Vision – pilot study (closed)

We are looking for volunteers to take part in our experiment. In the study we try to find out if dynamic visual events in peripheral vision have any impact on users’ concentration/attention. If you are interested in participating, please contact me per email or use the form below to provide information on what date and time you are able to come by Experiment duration: 25-30 minutes Location: University of Applied Sciences Bonn-Rhein-Sieg (Campus Sankt Augustin) Reward: 5-Euro Amazon Gutschein Contact: anton.sigitov [at] h-brs.de | M. Sc. Anton Sigitov | Research Associate | Institute of Visual Computing | Bonn-Rhein-Sieg University of Applied Sciences 

  • Subscribe to the Experiment-Newsletter
  • Interested in participating in upcoming experiments? Please subscribe to the newsletter!