Root/mlt/wpan-ipv4/edit

1#!/bin/sh
2#
3# Edit the wpan-ipv4 demo clip
4#
5# Written 2011 by Werner Almesberger
6# Copyright 2011 Werner Almesberger
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12#
13
14
15F=MVI_1374.MOV
16
17debug=false
18
19seg=1
20pos=0
21
22seg()
23{
24    echo '' -video-track -blank $pos $F in=$1 out=$2 \\
25    $debug && echo -attach watermark:+#$seg.txt \\
26    start=$pos
27    pos=`expr $pos + $2 - $1`
28    end=$pos
29    seg=`expr $seg + 1`
30}
31
32
33say()
34{
35    echo '' -track -blank $1 pango text="\"$3\"" in=$1 out=$2 \\
36    echo '' align=1 fgcolour=0xffffffff bgcolour=0x00000040 weight=400 \\
37    echo '' -transition composite out=$end geometry=0%,50%:100%x10% \\
38    echo '' halign=c a_track=0 \\
39}
40
41
42overlay()
43{
44    echo '' -track -blank $1 pango text="\"$3\"" in=$1 out=$2 \\
45    echo '' align=1 fgcolour=0x00000030 weight=600 \\
46    echo '' -transition composite out=$end geometry=-1%,94%:100%x6% \\
47    echo '' halign=r \\
48    [ "$4" ] && echo a_track=$4 \\
49}
50
51
52endtitle()
53{
54    echo '' -track -blank $1 pango text="\"$3\"" in=$1 out=$2 \\
55    echo '' align=1 fgcolour=0x000000ff weight=600 \\
56    echo '' -transition composite out=$end geometry=0%,50%:100%x10% \\
57    echo '' halign=c a_track=$4 \\
58}
59
60
61cmd()
62{
63    e=`expr $2 - 1`
64    echo '' -track -blank $1 pango text="\"$3\"" in=$1 out=$e \\
65    echo '' align=1 fgcolour=0xffff40ff weight=600 \\
66    echo '' -transition composite out=$end geometry=0%,83%:100%x7% \\
67    echo '' halign=c a_track=0 \\
68}
69
70
71explain()
72{
73    echo '' -track -blank $1 pango text="\"$3\"" in=$1 out=$2 \\
74    echo '' align=1 fgcolour=0x000000ff bgcolour=0xc0c0ffc0 weight=400 \\
75    echo '' -transition composite out=$end geometry=$4%,90%:100%x7% \\
76    echo '' a_track=0 \\
77}
78
79
80label()
81{
82    echo '' -track -blank $1 pango text="\"$3\"" in=$1 out=$2 \\
83    echo '' align=1 fgcolour=0xff2020ff weight=600 \\
84    echo '' -transition composite out=$end geometry=$4%,$5%:100%x10% \\
85    echo '' a_track=0 \\
86}
87
88
89echo melt \\
90echo colour:black out=50 \\
91seg 0 470 # 1
92echo '' -transition luma in=0 out=50 \\
93
94echo '' -audio-track p97-3fast.wav in=60 \\
95# "resample" sux - do this in SOX
96#echo '' -filter resample frequency=47000 \\
97
98seg 486 517 # 2
99seg 712 1864 # 3
100seg 1897 2785 # 4
101seg 2874 3082 # 5
102seg 3164 3300 # 6
103seg 3450 3889 # 7
104seg 4019 4703 # 8
105seg 4764 5595 # 9
106seg 5731 6103 # 10
107seg 0 580 # filler
108
109echo '' -track -blank 5130 colour:white in=5130 out=5200 \\
110echo '' -transition luma in=5130 out=5200 a_track=0 \\
111echo '' -track -blank 5200 colour:white in=5200 out=5800 \\
112overlay 5200 5600 "2011 by Werner Almesberger, CC-BY-SA"
113
114endtitle 5250 5600 "THE BEGINNING" 13
115
116overlay 10 100 "2011 by Werner Almesberger, CC-BY-SA" 0
117overlay 5150 5200 "2011 by Werner Almesberger, CC-BY-SA" 0
118
119label 70 150 "ben1" 35 59
120label 110 150 "ben2" 63 66
121say 230 280 "We won't need that"
122label 415 447 "OpenWRT" 20 51
123
124cmd 487 620 "iz add wpan-phy0"
125say 530 620 "Add WPAN interface"
126
127cmd 630 730 "ip link set wpan0 ..."
128cmd 730 840 "... address ca:fe:ca:fe:ca:fe:ca:fe"
129say 680 840 "Set MAC address"
130
131cmd 850 960 "ifconfig wpan0 up"
132say 900 960 "Enable WPAN interface"
133
134cmd 970 1140 "izcoordinator -d 1 -l lease -i wpan0 ..."
135explain 1020 1140 "Debug" 33
136explain 1040 1140 "Lease file" 48
137explain 1060 1140 "Interface" 70
138cmd 1140 1290 "... -p 0x777 -s 1 -c 11 &"
139explain 1190 1290 "PAN" 35
140explain 1210 1290 "Self" 51
141explain 1230 1290 "Chan" 62
142explain 1250 1290 "Fork" 75
143say 1100 1290 "WPAN coordinator"
144
145label 1660 1710 "Jlime" 55 53
146
147cmd 1770 1930 "iz add wpan-phy0"
148say 1800 1930 "Add WPAN interface"
149
150cmd 1940 2040 "ip link set wpan0 ..."
151cmd 2040 2170 "... address be:e2:be:e2:be:e2:b2:e2"
152# don't explain the joke :-)
153#cmd 2040 2140 "... address be:e2:be:e2:be:e2:b2:e2"
154#cmd 2141 2170 "... address be:eR:be:eR:be:eR:be:eR"
155say 2000 2170 "Set MAC address"
156
157cmd 2180 2277 "ifconfig wpan0 up"
158say 2230 2277 "Enable WPAN interface"
159
160cmd 2280 2520 "iz assoc wpan0 777 1 11 short"
161explain 2300 2370 "PAN" 52
162explain 2320 2370 "Coordinator" 62
163explain 2400 2520 "Chan" 58
164explain 2420 2520 "Short addr" 73
165say 2340 2520 "Get WPAN address"
166
167label 2550 2600 "<-- Request" 40 50
168label 2620 2670 "Response -->" 20 55
169
170cmd 2780 2880 "Received short address 8001"
171
172say 2950 3040 "Set up IP tunnel"
173
174cmd 3000 3150 "dirtpan 777 1 8001 ifconfig ..."
175explain 3050 3150 "PAN" 32
176explain 3070 3150 "Self" 41.2
177explain 3090 3150 "Peer" 50
178cmd 3150 3300 "... $ITF 10.0.0.1 dstaddr 10.0.0.2 up"
179explain 3200 3300 "Local" 24
180explain 3220 3300 "Remote" 63
181
182say 3330 3400 "The other end ..."
183say 3410 3500 "... of the tunnel"
184
185cmd 3410 3550 "dirtpan 777 8001 1 ifconfig ..."
186explain 3450 3550 "PAN" 33
187explain 3470 3550 "Self" 45.5
188explain 3490 3550 "Peer" 56
189cmd 3550 3700 "... $ITF 10.0.0.1 dstaddr 10.0.0.2 up"
190explain 3600 3700 "Local" 24
191explain 3620 3700 "Remote" 63
192
193cmd 3700 3960 "ping -c 10 10.0.0.1"
194say 3750 3960 "Test the connection"
195
196cmd 4170 4380 "ssh 10.0.0.1"
197cmd 4403 4470 "root@10.0.0.1 password:"
198
199cmd 4475 4605 "echo hello >/dev/tty0"
200explain 4500 4605 "Console" 56
201
202cmd 4770 4825 "hello"
203
204cmd 4870 4950 "pstree"
205
206cmd 4970 5070 "exit"
207
208if $debug; then
209    echo '' -consumer sdl audio_off=1
210else
211    echo '' -consumer avformat f=ogg vcodec=libtheora \\
212    echo b=600k acodec=libvorbis '>wpan-ipv4.ogg'
213fi
214

Archive Download this file

Branches:
master



interactive