1 | <!-- ******************************************************** --> |
---|
2 | <!-- --> |
---|
3 | <!-- [History] --> |
---|
4 | <!-- Converted to DocBook: Katsuya Amako, Aug-2006 --> |
---|
5 | <!-- --> |
---|
6 | <!-- ******************************************************** --> |
---|
7 | |
---|
8 | |
---|
9 | <!-- ******************* Section (Level#1) ****************** --> |
---|
10 | <sect1 id="sect.MkMovie"> |
---|
11 | <title> |
---|
12 | Making a Movie |
---|
13 | </title> |
---|
14 | |
---|
15 | <para> |
---|
16 | These instructions are suggestive only. The following procedures |
---|
17 | have not been tested on all platforms. There are clearly some |
---|
18 | instructions that apply only to Unix-like systems with an X-Windows |
---|
19 | based windowing system. However, it should not be difficult to take |
---|
20 | the ideas presented here and extend them to other platforms and |
---|
21 | systems. |
---|
22 | </para> |
---|
23 | |
---|
24 | <para> |
---|
25 | The procedures described here need graphics drivers that |
---|
26 | can produce picture files that can be converted to a form suitable |
---|
27 | for an MPEG encoder. There may be other ways of capturing the |
---|
28 | screen images and we would be happy to hear about them. Graphics |
---|
29 | drivers currently capable of producing picture files are: |
---|
30 | |
---|
31 | <informaltable> |
---|
32 | <tgroup cols="2"> |
---|
33 | <tbody> |
---|
34 | <row> |
---|
35 | <entry> |
---|
36 | <emphasis role="bold">Driver</emphasis> |
---|
37 | </entry> |
---|
38 | <entry> |
---|
39 | <emphasis role="bold">File type</emphasis> |
---|
40 | </entry> |
---|
41 | </row> |
---|
42 | <row> |
---|
43 | <entry> |
---|
44 | DAWNFILE |
---|
45 | </entry> |
---|
46 | <entry> |
---|
47 | prim then eps using <emphasis role="bold">dawn</emphasis> |
---|
48 | </entry> |
---|
49 | </row> |
---|
50 | <row> |
---|
51 | <entry> |
---|
52 | HepRepFile |
---|
53 | </entry> |
---|
54 | <entry> |
---|
55 | HepRep1 |
---|
56 | </entry> |
---|
57 | </row> |
---|
58 | <row> |
---|
59 | <entry> |
---|
60 | HepRep |
---|
61 | </entry> |
---|
62 | <entry> |
---|
63 | HepRep2 |
---|
64 | </entry> |
---|
65 | </row> |
---|
66 | <row> |
---|
67 | <entry> |
---|
68 | OGLX |
---|
69 | </entry> |
---|
70 | <entry> |
---|
71 | eps |
---|
72 | </entry> |
---|
73 | </row> |
---|
74 | <row> |
---|
75 | <entry> |
---|
76 | RayTracer |
---|
77 | </entry> |
---|
78 | <entry> |
---|
79 | jpeg |
---|
80 | </entry> |
---|
81 | </row> |
---|
82 | <row> |
---|
83 | <entry> |
---|
84 | VRMLFILE |
---|
85 | </entry> |
---|
86 | <entry> |
---|
87 | vrml |
---|
88 | </entry> |
---|
89 | </row> |
---|
90 | </tbody> |
---|
91 | </tgroup> |
---|
92 | </informaltable> |
---|
93 | </para> |
---|
94 | |
---|
95 | <para> |
---|
96 | So far, only DAWNFILE, OGLX and RayTracer have been "road tested". |
---|
97 | Once in a standard format, such as eps, the |
---|
98 | <emphasis role="bold">convert</emphasis> program from |
---|
99 | <ulink url="http://www.imagemagick.org"> |
---|
100 | ImageMagick |
---|
101 | </ulink> |
---|
102 | can convert to ppm files suitable for |
---|
103 | <emphasis role="bold">mpeg2encode</emphasis>. |
---|
104 | </para> |
---|
105 | |
---|
106 | |
---|
107 | <!-- ******************* Section (Level#2) ****************** --> |
---|
108 | <sect2 id="sect.MkMovie.OGLX"> |
---|
109 | <title> |
---|
110 | OGLX |
---|
111 | </title> |
---|
112 | |
---|
113 | <para> |
---|
114 | Make a macro something like this: |
---|
115 | |
---|
116 | <informalexample> |
---|
117 | <programlisting> |
---|
118 | /control/verbose 2 |
---|
119 | /vis/open OGLSX 600x600-0+0 |
---|
120 | /vis/drawVolume |
---|
121 | /vis/viewer/reset |
---|
122 | /vis/viewer/set/style surface |
---|
123 | /vis/viewer/set/projection perspective 50 deg |
---|
124 | /control/alias phi 30 |
---|
125 | /control/loop movie.loop theta 0 360 1 |
---|
126 | </programlisting> |
---|
127 | </informalexample> |
---|
128 | |
---|
129 | which invokes movie.loop, which is something like: |
---|
130 | |
---|
131 | <informalexample> |
---|
132 | <programlisting> |
---|
133 | /vis/viewer/set/viewpointThetaPhi {theta} {phi} |
---|
134 | /vis/viewer/zoom 1.005 |
---|
135 | /vis/ogl/printEPS |
---|
136 | </programlisting> |
---|
137 | </informalexample> |
---|
138 | </para> |
---|
139 | |
---|
140 | <para> |
---|
141 | This produces lots of eps files. Then... |
---|
142 | |
---|
143 | <informalexample> |
---|
144 | <programlisting> |
---|
145 | <ulink url="./make_mpeg2encode_parfile.sh">make_mpeg2encode_parfile.sh</ulink> G4OpenGL_*eps |
---|
146 | </programlisting> |
---|
147 | </informalexample> |
---|
148 | </para> |
---|
149 | |
---|
150 | <para> |
---|
151 | Then edit mpeg2encode.par to specify file type and size, etc.: |
---|
152 | |
---|
153 | <informalexample> |
---|
154 | <programlisting> |
---|
155 | $ diff mpeg2encode.par~ mpeg2encode.par |
---|
156 | 7c7 |
---|
157 | < 1 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ |
---|
158 | --- |
---|
159 | > 2 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ |
---|
160 | 15,17c15,17 |
---|
161 | < /* horizontal_size */ |
---|
162 | < /* vertical_size */ |
---|
163 | < 8 /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */ |
---|
164 | --- |
---|
165 | > 600 /* horizontal_size */ |
---|
166 | > 600 /* vertical_size */ |
---|
167 | > 1 /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */ |
---|
168 | </programlisting> |
---|
169 | </informalexample> |
---|
170 | </para> |
---|
171 | |
---|
172 | <para> |
---|
173 | Then convert to ppm: |
---|
174 | |
---|
175 | <informalexample> |
---|
176 | <programlisting> |
---|
177 | for i in G4OpenGL*eps; |
---|
178 | do j=`basename $i .eps`; command="convert $i $j.ppm"; echo $command; $command; done |
---|
179 | </programlisting> |
---|
180 | </informalexample> |
---|
181 | </para> |
---|
182 | |
---|
183 | <para> |
---|
184 | Then |
---|
185 | |
---|
186 | <informalexample> |
---|
187 | <programlisting> |
---|
188 | mpeg2encode mpeg2encode.par G4OpenGL.mpg |
---|
189 | </programlisting> |
---|
190 | </informalexample> |
---|
191 | </para> |
---|
192 | |
---|
193 | <para> |
---|
194 | Then, on Mac, for example: |
---|
195 | |
---|
196 | <informalexample> |
---|
197 | <programlisting> |
---|
198 | open G4OpenGL.mpg |
---|
199 | </programlisting> |
---|
200 | </informalexample> |
---|
201 | |
---|
202 | opens a QuickTime player. |
---|
203 | </para> |
---|
204 | |
---|
205 | </sect2> |
---|
206 | |
---|
207 | |
---|
208 | <!-- ******************* Section (Level#2) ****************** --> |
---|
209 | <sect2 id="sect.MkMovie.DAWNFILE"> |
---|
210 | <title> |
---|
211 | DAWNFILE |
---|
212 | </title> |
---|
213 | |
---|
214 | <para> |
---|
215 | You need to invoke <emphasis role="bold">dawn</emphasis> in "direct" mode, |
---|
216 | which picks up parameters from .DAWN_1.history, and suppress the GUI: |
---|
217 | |
---|
218 | <informalexample> |
---|
219 | <programlisting> |
---|
220 | alias dawn='dawn -d' |
---|
221 | export DAWN_BATCH=1 |
---|
222 | </programlisting> |
---|
223 | </informalexample> |
---|
224 | </para> |
---|
225 | |
---|
226 | <para> |
---|
227 | Change OGLSX to DAWNFILE in the above set of Geant4 commands and |
---|
228 | run. Then convert to ppm files as above: |
---|
229 | |
---|
230 | <informalexample> |
---|
231 | <programlisting> |
---|
232 | for i in g4_*.eps; |
---|
233 | do j=`basename $i .eps`; command="convert $i $j.ppm"; echo $command; $command; done |
---|
234 | </programlisting> |
---|
235 | </informalexample> |
---|
236 | </para> |
---|
237 | |
---|
238 | <para> |
---|
239 | Then make a .par file: |
---|
240 | |
---|
241 | <informalexample> |
---|
242 | <programlisting> |
---|
243 | <ulink url="./make_mpeg2encode_parfile.sh">make_mpeg2encode_parfile.sh</ulink> g4_*ppm |
---|
244 | </programlisting> |
---|
245 | </informalexample> |
---|
246 | |
---|
247 | and edit mpeg2encode.par: |
---|
248 | |
---|
249 | <informalexample> |
---|
250 | <programlisting> |
---|
251 | $ diff mpeg2encode.par~ mpeg2encode.par |
---|
252 | 7c7 |
---|
253 | < 1 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ |
---|
254 | --- |
---|
255 | > 2 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ |
---|
256 | 9c9 |
---|
257 | < 1 /* number of first frame */ |
---|
258 | --- |
---|
259 | > 0 /* number of first frame */ |
---|
260 | 15,16c15,16 |
---|
261 | < /* horizontal_size */ |
---|
262 | < /* vertical_size */ |
---|
263 | --- |
---|
264 | > 482 /* horizontal_size */ |
---|
265 | > 730 /* vertical_size */ |
---|
266 | </programlisting> |
---|
267 | </informalexample> |
---|
268 | </para> |
---|
269 | |
---|
270 | <para> |
---|
271 | Then encode and play: |
---|
272 | |
---|
273 | <informalexample> |
---|
274 | <programlisting> |
---|
275 | mpeg2encode mpeg2encode.par DAWN.mpg |
---|
276 | open DAWN.mpg |
---|
277 | </programlisting> |
---|
278 | </informalexample> |
---|
279 | </para> |
---|
280 | |
---|
281 | </sect2> |
---|
282 | |
---|
283 | |
---|
284 | <!-- ******************* Section (Level#2) ****************** --> |
---|
285 | <sect2 id="sect.MkMovie.RyTrcX"> |
---|
286 | <title> |
---|
287 | RayTracerX |
---|
288 | </title> |
---|
289 | |
---|
290 | <para> |
---|
291 | <informalexample> |
---|
292 | <programlisting> |
---|
293 | /control/verbose 2 |
---|
294 | /vis/open RayTracerX 600x600-0+0 |
---|
295 | # (Raytracer doesn't need a scene; smoother not to /vis/drawVolume.) |
---|
296 | /vis/viewer/reset |
---|
297 | /vis/viewer/set/style surface |
---|
298 | /vis/viewer/set/projection perspective 50 deg |
---|
299 | /control/alias phi 30 |
---|
300 | /control/loop movie.loop theta 0 360 1 |
---|
301 | </programlisting> |
---|
302 | </informalexample> |
---|
303 | |
---|
304 | where movie.loop is as above. This produces lots of jpeg files (but |
---|
305 | takes 3 days!!!). Then... |
---|
306 | |
---|
307 | <informalexample> |
---|
308 | <programlisting> |
---|
309 | <ulink url="./make_mpeg2encode_parfile.sh">make_mpeg2encode_parfile.sh</ulink> g4RayTracer*jpeg |
---|
310 | </programlisting> |
---|
311 | </informalexample> |
---|
312 | </para> |
---|
313 | |
---|
314 | <para> |
---|
315 | Then edit mpeg2encode.par to specify file type and size, etc.: |
---|
316 | |
---|
317 | <informalexample> |
---|
318 | <programlisting> |
---|
319 | $ diff mpeg2encode.par.orig mpeg2encode.par |
---|
320 | 7c7 |
---|
321 | < 1 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ |
---|
322 | --- |
---|
323 | > 2 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ |
---|
324 | 15,17c15,17 |
---|
325 | < /* horizontal_size */ |
---|
326 | < /* vertical_size */ |
---|
327 | < 8 /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */ |
---|
328 | --- |
---|
329 | > 600 /* horizontal_size */ |
---|
330 | > 600 /* vertical_size */ |
---|
331 | > 1 /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */ |
---|
332 | </programlisting> |
---|
333 | </informalexample> |
---|
334 | </para> |
---|
335 | |
---|
336 | <para> |
---|
337 | |
---|
338 | Then convert to ppm, encode and play: |
---|
339 | |
---|
340 | <informalexample> |
---|
341 | <programlisting> |
---|
342 | for i in g4*jpeg; |
---|
343 | do j=`basename $i .jpeg`; command="convert $i $j.ppm"; echo $command; $command; done |
---|
344 | mpeg2encode mpeg2encode.par g4RayTracer.mpg |
---|
345 | open g4RayTracer.mpg |
---|
346 | </programlisting> |
---|
347 | </informalexample> |
---|
348 | </para> |
---|
349 | |
---|
350 | |
---|
351 | </sect2> |
---|
352 | </sect1> |
---|