LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-10-2011, 03:47 PM   #1
Dstruct0
Member
 
Registered: Jun 2005
Distribution: Debian Etch, Lenny, Squeeze
Posts: 37

Rep: Reputation: 0
Exact time of image capture and Unicap library for video capture devices


I've a question about Unicap library(an uniform interface for video capture devices).



My question is like this:

I want to know the exact time when an image is captured by a ps3 eye camera.

I know how to capture images using Unicap and Unicap-Gtk and display it using ps3eye. No problem there.

But I can't figure out a way to get the exact time of image capture.

Is there any function or a structure or some other method in Unicap library to know the exact time when an image is captured?



Is it possible to kindly tell me tell me if this problem can be solved or not? If yes how? If no why not?

Note:I'm using Debian Squeeze

Last edited by Dstruct0; 09-10-2011 at 03:50 PM.
 
Old 09-10-2011, 04:50 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Can you post the code that calls the unicap function to perform the capture? I'm sure there's a way to get a certain block of code to execute immediately after the capture. What do you mean by exact time, anyway? To what resolution?
Kevin Barry
 
Old 09-10-2011, 05:49 PM   #3
Dstruct0
Member
 
Registered: Jun 2005
Distribution: Debian Etch, Lenny, Squeeze
Posts: 37

Original Poster
Rep: Reputation: 0
Thank you ta0kira for your reply. My sample code is:



Code:
#include <unicap.h>
#include <unicapgtk.h>


int
main (int argc, char **argv)
{
  GtkWidget *window;
  GtkWidget *ugtk_display;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit),
                    NULL);

  ugtk_display = unicapgtk_video_display_new_by_device (NULL);  
  gtk_container_add (GTK_CONTAINER (window), ugtk_display);
  unicapgtk_video_display_start (UNICAPGTK_VIDEO_DISPLAY (ugtk_display));       

  gtk_widget_show_all (window);
  gtk_main ();

  return 0;
}

>ta0kira said:
> What do you mean by exact time, anyway? To what resolution?


I've 6 ps3 eye cameras. And by connecting a wire from VSYNC output of 1st camera to FSIN input of 2nd camera then VSYNC output of 2nd camera to FSIN input of 3rd camera then...... i want to sync all 6 cameras(A method used to sync multi ps3eyes).

So theoretically all the captured frames should be synced to 1st camera and the same image in real world will be captured by all 6 cameras.


Now I need a way to know if all the cameras are synced properly to first camera. That's why i need the time. And by "exact time" I mean the time it took the cameras to be synced and capture the frames without transferring the image data through usb wires. The resolution is 320x240@60fps


So is it possible to know(using Unicap lib) when the frames are "exactly" captured without transferring the data?
 
Old 09-10-2011, 06:34 PM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by Dstruct0 View Post
I've 6 ps3 eye cameras. And by connecting a wire from VSYNC output of 1st camera to FSIN input of 2nd camera then VSYNC output of 2nd camera to FSIN input of 3rd camera then...... i want to sync all 6 cameras(A method used to sync multi ps3eyes).

So theoretically all the captured frames should be synced to 1st camera and the same image in real world will be captured by all 6 cameras.


Now I need a way to know if all the cameras are synced properly to first camera. That's why i need the time. And by "exact time" I mean the time it took the cameras to be synced and capture the frames without transferring the image data through usb wires. The resolution is 320x240@60fps


So is it possible to know(using Unicap lib) when the frames are "exactly" captured without transferring the data?
So you need to know the time within 1/60th of a second? The timestamp of the image isn't enough? If you need to ensure high-speed sync you're better off investing in hardware that's guaranteed to sync within a certain tolerance, and/or using a low-latency kernel. I mistakenly thought you needed the timing of a single frame from a single device.
Kevin Barry
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Video Capture Devices Scarletdown Linux - Hardware 1 05-31-2011 12:07 PM
Which of my 3 video capture devices will work best with my PC? sergep71 Linux - Hardware 1 03-24-2010 11:43 AM
fc4: video capture image is jittery and shaky bkahler Fedora 1 03-20-2006 05:23 AM
Camera image capture and real time processing sumeetpalsingh Linux - General 0 09-10-2005 02:30 PM
Capture support for dvd and video capture in linux is it even going to be real ever? maximalred Linux - Distributions 3 07-06-2003 07:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration