annotate TOOLS/mplmult.sh @ 29773:17fe39ab8693

add audio format 0x55005354 to mp3, fixes unknown_audio_codec.avi
author compn
date Tue, 03 Nov 2009 19:45:43 +0000
parents 998475fffe0c
children 7bdb1c022122
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29611
998475fffe0c Avoid bash-specific 'let' syntax in shell scripts.
diego
parents: 27199
diff changeset
1 #!/bin/sh
14410
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
2 # example how to output video on multiple windows in sync.
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
3 # might be even more useful in combination with vo ggi
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
4 # to distribute the video arbitrarily
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
5
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
6 dir=/tmp/$$
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
7 count=$1
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
8 shift
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
9
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
10 if test 0"$count" -lt 1; then
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
11 echo "At least 1 slave instance must be used."
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
12 echo ""
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
13 echo "Usage:"
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
14 echo "./mplmult.sh n mplayer-opts"
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
15 echo "n number of MPlayer instances that display the video"
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
16 echo "mplayer-opts anything you would specify to mplayer,"
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
17 echo " more than one file will usually not work"
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
18 exit 1
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
19 fi
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
20
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
21 mkdir -m 700 $dir
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
22 if test $? -ne 0; then
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
23 echo "Could not create temp dir!"
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
24 exit 1
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
25 fi
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
26
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
27 mkfifo $dir/stream.yuv
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
28 i=1
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
29 fifo_list=""
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
30 while test $i -le $count; do
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
31 fifo_list="$dir/mp$i $fifo_list"
29611
998475fffe0c Avoid bash-specific 'let' syntax in shell scripts.
diego
parents: 27199
diff changeset
32 i=$(($i+1))
14410
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
33 done
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
34
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
35 mkfifo $fifo_list
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
36 (cat $dir/stream.yuv | tee $fifo_list > /dev/null ) &
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
37 for fifo in $fifo_list; do
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
38 # -benchmark is neccessary so that it will not do any timing.
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
39 # the master instance already takes care of it and not specifying
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
40 # it will break A-V sync.
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
41 mplayer -nocache -quiet -benchmark "$fifo" > /dev/null 2>&1 &
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
42 done
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
43 mplayer -nocache -fixed-vo -vo yuv4mpeg:file=$dir/stream.yuv "$@"
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
44
9b7f3566b603 Playback video with multiple windows.
reimar
parents:
diff changeset
45 rm -rf $dir