Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

need help saving videos from GigE camera to AVI

Highlighted

I'm currently using the "grab and scalable format" VI as a template for acquiring images from my camera. The VI works great but I want to be able to save the images to a file. I've been able to get it to work but have had a few problems so far. If I start recording, and then change the camera position I immediately get an error. I really wanna be able to start and stop recording multiple times and change the positioning without restarting the VI.

I've had a few idea's but I can't seem to get them to work:

1. Making it so that every time I hit record it asks me for a new file name. (I tried putting the dialogue in the while loop but that causes a chain of it asking me where i want to put the file and I can't figure out how to get around this). And ideally it wouldn't let me record over existing files.

2. Same as above but maybe it would be easiest to have labview grab the date and time and use that as the file name?

3. Is there a way to make it so that despite changing the size it will still work with the "write avi file" and I do not have to use a different file name?

I've attached the VI for those interested and thank you!

 

Labview version 8.5.1

0 Kudos
Message 1 of 5
(1,363 Views)

Hey,

 

Maybe the west way to do what you want is to create a producer consumer architecture. Where you save the captured avi in the consumer loop. This is assuming that by moving the camera you dont mean completely disconnecting it.

 

1&2) Under programming, timing, place a get Date and Time. This will give you a string that you can manipulate using the string palette and wire it appropriately.

3) I am not sure if changing the size would work when you are writing the avi file. What currently happens when you try to change the size? Does it give you an error.

 

Regards,

A. Zaatari

National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(1,348 Views)

Yea the way I currently have it set up is that the camera initializes and prompts you with a save dialogue. Then the camera enters its while loop for grabbing images. In that while loop I have a case structure with a recording and non recording state. What happens when you change the roi is the camera actually disconfigures, sets the new properties in a property node, and then reconfigures and keeps grabbing. If I change the ROI while grabbing I get an error with the write AVI function. I also wish it would only ask you for the file name when you hit record, but in order to do this it seems like I would need to put the prompt in the while loop, causing an infinite loop of prompts. 

0 Kudos
Message 3 of 5
(1,345 Views)

Hey Mr. Smithers,

 

I have found a shipping example that might be helpful. It uses event structures to configure the camera and no conflict occurs with the acquisition. 

 

Regards,

A. Zaatari

 

National Instruments
Applications Engineer
0 Kudos
Message 4 of 5
(1,329 Views)

“Maybe the west way to do what you want is to create a producer consumer architecture. Where you save the captured avi in the consumer loop. This is assuming that by moving the camera you dont mean completely disconnecting it. 1&2) Under programming, timing, place a get Date and Time. This will give you a string that you can manipulate using the string palette and wire it appropriately. 3) I am not sure if changing the size would work when you are writing the avi file. What currently happens when you try to change the size? Does it give you an error”

 

No more errors to me. I followed these directions and everything went right. Finally I see the light! Great advice! I had the same situation and I could solve it thanks to you! I tried many things but just till know I could do what I was trying to do.

0 Kudos
Message 5 of 5
(1,319 Views)