<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1255">
<META content="MSHTML 5.50.4522.1800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2> Hi All</FONT></DIV>
<DIV><FONT face=Arial size=2>Does anybody know , how to connect mpeg video with
vtkVideoSource in next tcl sample</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>package require vtk</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>vtkImageReader2 mpeg<BR>mpeg SetFileName
random.mpg<BR>mpeg Update</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>vtkVideoSource grabber<BR>grabber SetInput [mpeg
GetOutput] ;# not existing method !!!<BR>grabber
SetOutputFormatToRGB <BR>grabber SetFrameSize 320 240 1<BR>grabber
SetOutputWholeExtent 0 159 0 119 0 0<BR>grabber SetFrameBufferSize 26<BR>grabber
SetNumberOfOutputFrames 26<BR>grabber Grab <BR>[grabber GetOutput]
UpdateInformation </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>vtkImageViewer viewer <BR>viewer SetInput
[grabber GetOutput] <BR>#[viewer GetImageWindow]
DoubleBufferOn <BR>viewer SetColorWindow 255 <BR>viewer SetColorLevel
127.5 <BR>viewer SetZSlice 0 </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>viewer Render </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>proc animate {} {<BR> if {
[grabber GetPlaying] == 1 } {viewer Render; after 1 animate}<BR>} </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>proc Play {} {if { [grabber GetPlaying] != 1 }
{grabber Play; animate}} </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>proc Stop {} {grabber Stop} </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>proc Grab {} {grabber Grab; viewer Render}
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>proc SetFrameRate { r } {grabber SetFrameRate
$r} </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>proc SetFrame { f } {viewer SetZSlice $f ; viewer
Render}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>wm withdraw .<BR>toplevel .t<BR>frame .t.controls
<BR>button .t.controls.grab -text "Grab" -command Grab <BR>pack .t.controls.grab
-side left <BR>button .t.controls.stop -text "Stop" -command Stop <BR>pack
.t.controls.stop -side left <BR>button .t.controls.play -text "Play" -command
Play <BR>pack .t.controls.play -side left <BR>pack .t.controls -side top
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>frame .t.rate <BR>label .t.rate.label -text
"Frames/s" <BR>scale .t.rate.scale -from 0.0 -to 60.0 -orient horizontal
-command SetFrameRate<BR>.t.rate.scale set [grabber GetFrameRate]
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>pack .t.rate.label -side left <BR>pack
.t.rate.scale -side left <BR>pack .t.rate -side top </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>frame .t.viewframe<BR>label .t.viewframe.label
-text "Frame #" <BR>scale .t.viewframe.scale -from 0 -to 25 -orient horizontal
-command SetFrame</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>pack .t.viewframe.label -side left <BR>pack
.t.viewframe.scale -side left <BR>pack .t.viewframe -side top </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>frame .t.ex <BR>button .t.ex.button -text
"Exit" -command ::vtk::cb_exit<BR>pack .t.ex.button -side left <BR>pack .t.ex
-side top <BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Thanks a lot. Leonid</DIV></FONT></BODY></HTML>