[vtkusers] How can i read a stack of Jpeg File + vtkMPEG2Writer

Fireman Fireman vtkusersneedhelp at yahoo.fr
Mon Feb 1 06:26:07 EST 2010


Hi Vtkusers,

I' m trying to use vtkMPEG2Writer to produce un Mpeg file from a stack of JPEG File.
 
I'm using the vtkJPEGReader to read the stack of jpeg images.
 
My problem is that the output MPEG file contains only the first image. 
 
Bellow the source code :

//**************************************
vtkJPEGReader *reader = vtkJPEGReader::New( );
 
vtkMPEG2Writer *w = vtkMPEG2Writer::New();
 
w->SetInputConnection(reader->GetOutputPort());
 
w->SetFileName("TestMovieWriter.mpg");
 
w->Start();
 
for ( int cpt = 1; cpt <=30 ;cpt ++ )
{
         reader->SetFileName("test"+QString::number(cpt)+".jpg");
         
        reader->Update();
 
        w->Write();
}
 
w->End(); 
//****************************************************
 
 
Thank you
 
 
 


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100201/62775066/attachment.htm>


More information about the vtkusers mailing list