[vtkusers] how to write a video with vtkAVIWriter and interacting with the gui

Hikaruchan Sandra.Schroetter.fl at ait.ac.at
Wed Nov 9 08:17:37 EST 2011


Hi!

I actually write a video via the vtkAVIWriter which works. But when writing
the video the user can not interact with the gui. Is there any way to allow
the user to interact with the gui, while writing the video? Because I want
to start the rendering via pressing a Record-Button, but the user should
also be able to stop the recording via a stop recording button.

here is my code where I write the video:

void MainWindow::slot_recordTimeButtonPressed(){

	vtkAVIWriter *avi = vtkAVIWriter::New();
	vtkWindowToImageFilter *w2i=vtkWindowToImageFilter::New();
	w2i->SetInput(mri3D->GetRenderWindow());//the render window
	avi->SetFileName("OutputVideo.avi");
	avi->SetInputConnection(w2i->GetOutputPort());
	avi->SetRate(25);
	avi->SetQuality(2);

	avi->Start();
	for ( int cc = actTimeStep; cc < (maxTimeSlices); cc++ ){	
		slidertime->setValue(cc);
		w2i->Modified();//importante
		for(int i = 0; i < 25; ++i){
			avi->Write();
		}
	}
	avi->End();

	//clean
	avi->Delete();
	w2i->Delete(); 

}

Dear Hikaru


--
View this message in context: http://vtk.1045678.n5.nabble.com/how-to-write-a-video-with-vtkAVIWriter-and-interacting-with-the-gui-tp4977645p4977645.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list