View Full Version : output to videopipe
living
August 23rd, 2005, 06:03 PM
I want to add Video-effects to ARToolkit.
The most simple way would be to redirect the output of ARToolKit (simpleVRML) into a vlooppback videopipe...
Has anyone an idea how to do this?
How do i redirect the Videostream to a videopipe instead of the Display.
THX
living
August 24th, 2005, 09:20 PM
impossible?
philip_lamb
August 24th, 2005, 10:27 PM
You can capture the output of the OpenGL pipeline by using readpixels (if you have access to the source code of the app you want to capture) or using something like wireGL if you don't have sourcecode access.
Use google.
living
August 24th, 2005, 11:18 PM
ok thanks for the reply. i will start googeling ...
living
August 26th, 2005, 08:00 PM
I have now tried the readpixels way.
i think i have been able to get the frames and to write the into the /dev/video0 vloopbackdevice
but on /dev/video1 ... i get no out put any idea? i've used the following code
void writeFrameBuffer(char *filename){
FILE *fp = fopen(filename, "wb");
int data_size = frame_width*frame_height*3;
unsigned char *framebuffer = malloc(data_size * sizeof(unsigned char));
glReadPixels(0, 0, frame_width, frame_height, GL_RGB, GL_UNSIGNED_BYTE, framebuffer);
printf("P6\n%d %d\n%d\n", frame_width, frame_height, 255);
fwrite(framebuffer, data_size, 1, fp);
fclose(fp);
}
This function i call at the end of the Idle function in simpleVRML
glutPostRedisplay();
writeFrameBuffer("/dev/video0");
living
August 26th, 2005, 08:01 PM
ah i am running debian Linux and ARTooolKit 2.70.1
living
August 29th, 2005, 05:47 PM
After this i get the Message that ressource /dev/video0 is busy. But when i want to get the output from /dev/video1 .... there is nothing ....
What did i forgot? do i hav a big missing in my code?
Sorry for my questions i am a VideoLinus Newbee
What i want is to redirect the simpleVRML output to a videopipe (/dev/video0)
.. so that i after can get that video with tools like FreeJ or effectv ...
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.