Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   FRC Control System (http://www.chiefdelphi.com/forums/forumdisplay.php?f=176)
-   -   Recording with the Camera (http://www.chiefdelphi.com/forums/showthread.php?t=77604)

byteit101 17-06-2009 17:30

Re: Recording with the Camera
 
We were able to save video from the camera to the crio's 2GBish drive, and then copy it to a computer and assemble it into a avi on a laptop. in the code we used imaqSaveImage or imaqWriteImage (look in nivision.h) to save to a folder, and just ftp'ed to ftp://10.xx.yy.2/ and copied it off after matches. we used a simple C# program that i wrote to play it back, and vidshot capture to save it to avi. here are some of ours:
http://thecatattack.org/VOB/Practice...ilermaker2009/
http://thecatattack.org/VOB/Practice...ilermaker2009/
http://thecatattack.org/VOB/Match4Boilermaker2009/

biojae 05-07-2009 00:18

Re: Recording with the Camera
 
you can make the videos directly on the cRio
(it probably takes more space to store though)

AVISession imaqCreateAVI(const char* fileName, const char* compressionFilter, int quality, unsigned int framesPerSecond, unsigned int maxDataSize);
int imaqWriteAVIFrame(Image* image, AVISession session, const void* data, unsigned int dataLength);
int imaqCloseAVI(AVISession session);

Greg McKaskle 05-07-2009 01:08

Re: Recording with the Camera
 
Quote:

you can make the videos directly on the cRio
(it probably takes more space to store though)
I think you will find that the AVI functions are documented for IMAQ in general, and they are in the header file as well, but they will not work on a nonWindows OS. I'm not sure if you will get a runtime error or a compiler error.

Greg McKaskle

biojae 06-07-2009 01:04

Re: Recording with the Camera
 
1 Attachment(s)
Quote:

Originally Posted by Greg McKaskle (Post 865733)
I think you will find that the AVI functions are documented for IMAQ in general, and they are in the header file as well, but they will not work on a nonWindows OS. I'm not sure if you will get a runtime error or a compiler error.

Greg McKaskle

well, i will try it out on saturday then, (my team doesn't really do offseason robot work and thats the only time that i will have with the robot until IRI), i would imagine that it would at least compile if its in the header file.

just throwing around ideas, as i have enough time to sift through the huge NIvision.h
(Really 200 defines, 150 typedefs and 50 functions in 1 file :ahh:)
i think NI should refactor that thing :]

i did have ours take pictures when a button was pushed on the joystick though

(image taken at LA regional during camera calibration time)

byteit101 06-07-2009 14:14

Re: Recording with the Camera
 
Quote:

Originally Posted by biojae (Post 865730)
you can make the videos directly on the cRio
(it probably takes more space to store though)

AVISession imaqCreateAVI(const char* fileName, const char* compressionFilter, int quality, unsigned int framesPerSecond, unsigned int maxDataSize);
int imaqWriteAVIFrame(Image* image, AVISession session, const void* data, unsigned int dataLength);
int imaqCloseAVI(AVISession session);

we tried that, and it does not work.
http://decibel.ni.com/content/thread/2473?tstart=30
Quote:

This may be due to these functions not be expected to be used by FIRST teams (all of the standard FIRST Vision functions use JPEGs), and therefore are not found in the headerfile. This being said I will double check with R&D to see if this is the case.



Cheers,

Mark

NI FIRST Support
Also, I'm not sure how it works, but it maybe choppy, even if it did work, say you get 3 images in 10ms, then it slows down and the next 3 images are taken over 30ms. we compensated this by saving the images as picnumb auto/telop enable/disable timestamp cameraCapt.jpg (ex. 05 ae 128963 cameraCapt.jpg) and used the timestamp's to set the delay for the next photo. before we did this, we had it play at the average speed, fixed at 16ms, and you can see it slow down, and then speed back up.

Greg McKaskle 06-07-2009 18:18

Re: Recording with the Camera
 
The AVI stuff will work on a desktop development computer running Windows. It will not work on the PPC cRIO running vxWorks.

The second part about choppy is valid, but the times listed aren't. The camera will not return images faster than one every 33ms, and even that is dependent upon the lighting, size, etc.

I'm not that knowledgeable of codecs for video encoding. Ideally, you'd select one that allows for arbitrary timings on the frames. I'm not sure which support that.

Greg McKaskle


All times are GMT -5. The time now is 16:42.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi