Jump to content

Basler camera, save avi video


Recommended Posts

Posted

Hi everyone, I am trying to watch a process and record video of it sometimes. So I need a button that starts recording and then stops it. And again when I click start it should create a new file with new name.

I have tried it in different ways, putting create file inside case structure and outside of structure etc. But I am either getting only 1 video(which overwrites), or just pictures. 

Lastly I have tried with shift register and got this error: Error -1074395995 occurred at IMAQ WriteBMPFile

I would appriciate if you could help me. 

Basler Camera labview.vi

Posted

You are likely getting only 1 video because you are re-using the same filename.

There are a bunch of ways to solve your problem. For me the easiest would be to look to using an Event Structure as this stops you from needing to poll the button all the time. Do a bit of googling to see how the Event Structure works. (tip, you will configure an event that responds to the save button click, and in that event you will prompt for a new filename (or autogenerate with timestamp) and then open a reference to this new file).

 

  • Confused 1
Posted

Hi Neil, 

I have tried with event structure as well; what I did was put create file and path into the event structure. In this case, should close avi be outside while loop? 

If close vi is inside event structure I am getting an infinite number of videos. 

If I put close vi outside of the loop, what should I connect to the line that goes to close vi, in false case or event? 

Where should I place path, create, write and close vis? 

Posted

Close should be inside the loop. Before you start a new file you would close the old one.

The file reference you get from opening the file would be put onto a shift register so that you can access it in the next iteration of the while loop.

Can you share your code?

  • Thanks 1
Posted
3 hours ago, Neil Pate said:

You are likely getting only 1 video because you are re-using the same filename.

There are a bunch of ways to solve your problem. For me the easiest would be to look to using an Event Structure as this stops you from needing to poll the button all the time. Do a bit of googling to see how the Event Structure works. (tip, you will configure an event that responds to the save button click, and in that event you will prompt for a new filename (or autogenerate with timestamp) and then open a reference to this new file).

 

 

31 minutes ago, Neil Pate said:

Close should be inside the loop. Before you start a new file you would close the old one.

The file reference you get from opening the file would be put onto a shift register so that you can access it in the next iteration of the while loop.

Can you share your code?

Should the path file be outside of the loop?

When I new file name created I should connect it to right side shift register? 

camera new problem.png

Basler Camera labview (1).vi

Posted

Yes, I will be able to go to lab and edit code next week.  I dont exactly know how to use shift register in this situation, so I will connect the reference file (do I create it inside or outside of while loop? or should I put file path outside and create file inside loop?)  to shift register, but I should connect it to close vi as well at the same time? 

Thank you for your time

Posted

A bit sad to have to say this nowadays that most of the traffic on this forum is about leaked videos, money rituals and human sacrifices, but isn't this the part where someone starts to repost links to basic LabVIEW training resources on the NI site?

  • Like 1
Posted

@Natiq this (non-functional example) should be enough to get you started. The weird arrow thing on the boundaries of the while loop is a shift register.

The event structure can also be configured to have a timeout case where you can then perform other stuff, like reading your image and writing it to the reference on the the shift register.

image.png.04c49f5dfa5185f84d43e44e49c44cad.png

There is heaps of information out there (YouTube for example), a bit of searching will lead to some more details.

  • Like 1
Posted

I hope I understood your point right, and made a vi based on that. But I am getting the first error even and if I press continue I get 2nd error. I checked with my previous codes where I was getting continous videos it is working again so I suppose *file not found* is not the reason. 

But when I use shift register I get an error. 

I would appriciate if you could help me. 

Note: I watched videos about event structure and Shift registers. But still can not solve this issue. 

Camera bd.png

camera error 1.png

error 2.png

camera time out.png

Basler Camera labview trial 2.vi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.