summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-07 11:11:02 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-07 11:11:02 +0000
commit3501332aab26902804c5436fba33233241161f60 (patch)
tree8575b9c3dfe0bf1271f59d974c2b1d52bf000ee6 /TOOLS
parent40b127ae8dc0fc202b810fe931494ccc926e7270 (diff)
downloadmpv-3501332aab26902804c5436fba33233241161f60.tar.bz2
mpv-3501332aab26902804c5436fba33233241161f60.tar.xz
Playback video with multiple windows.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14411 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS')
-rwxr-xr-xTOOLS/mplmult.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/TOOLS/mplmult.sh b/TOOLS/mplmult.sh
new file mode 100755
index 0000000000..a597bcf03e
--- /dev/null
+++ b/TOOLS/mplmult.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+# example how to output video on multiple windows in sync.
+# might be even more useful in combination with vo ggi
+# to distribute the video arbitrarily
+
+dir=/tmp/$$
+count=$1
+shift
+
+if test 0"$count" -lt 1; then
+ echo "At least 1 slave instance must be used."
+ echo ""
+ echo "Usage:"
+ echo "./mplmult.sh n mplayer-opts"
+ echo "n number of MPlayer instances that display the video"
+ echo "mplayer-opts anything you would specify to mplayer,"
+ echo " more than one file will usually not work"
+ exit 1
+fi
+
+mkdir -m 700 $dir
+if test $? -ne 0; then
+ echo "Could not create temp dir!"
+ exit 1
+fi
+
+mkfifo $dir/stream.yuv
+i=1
+fifo_list=""
+while test $i -le $count; do
+ fifo_list="$dir/mp$i $fifo_list"
+ let i=$i+1
+done
+
+mkfifo $fifo_list
+(cat $dir/stream.yuv | tee $fifo_list > /dev/null ) &
+for fifo in $fifo_list; do
+ # -benchmark is neccessary so that it will not do any timing.
+ # the master instance already takes care of it and not specifying
+ # it will break A-V sync.
+ mplayer -nocache -quiet -benchmark "$fifo" > /dev/null 2>&1 &
+done
+mplayer -nocache -fixed-vo -vo yuv4mpeg:file=$dir/stream.yuv "$@"
+
+rm -rf $dir