01-16-2025 09:18 AM
Hi everyone,
I have a basler camera and I want to use it to see a certain process. And sometimes I need to secord the process. for that I created a case structure to have a start recording button in front panel.
The problem is I dont get a proper video, even I record for 30 seconds I get a 0 seond 'video'.
How can I solve this problem?
thanks in adcance
Solved! Go to Solution.
01-16-2025 03:40 PM
You want to start the video once, then use the "write frame" VI over and over to record each image as a frame of your video.
01-16-2025 03:58 PM
Is your camera set up so that it "talks" to LabVIEW and is capable of recording a Video?
To find out, do the following:
If the answer is "No", you need to figure out how to connect it. Next:
Wasn't that easy? (I'm assuming it worked).
Now, let's take a brief look at your code. Before putting all the Bells and Whistles into the code, try to get a simple Picture or Video (a "Snap" or a "Grab"). Let the Camera figure out the settings. Don't start with a "Do Everything" Express VI (or if you must, leave most of the Controls unwired so they take their default values).
Forget the Camera, look at your basic LabVIEW structure. You have a While Loop that runs until you push Camera, and then it stops. [Camera? Isn't "Stop" a better name for this control?]. Inside this (let's call it) "Camera Loop", there is a Case Statement governed by a Boolean called "Start Camera". [Another spectacularly wrong name -- yes, the code inside the True branch will run as long as you don't press the switch again, but what does it do? Who knows? Maybe it creates one (or more) images (depending on the speed of the loop).
Each time it runs, one image comes out and goes to a Case Statement "on top". If "Start Recording" is False, nothing happens. If it is True, you open an AVI file, write the (single) image to the file, then close the file. When/if another image comes in, you do the same thing, overwriting the previous image. Is this what you want to do?
My advice is to concentrate on writing simple IMAQdx code to do a Snap (single Image) to an Image Window, and when that works, try programming a Grab.
I must say, as I have dabbled in a variety of interesting aspects of LabVIEW, one of the most challenging things I encountered was LabVIEW Vision. Fortunately, I had a colleague who needed my help straightening out his convoluted VIs, and we more-or-less "taught ourselves" how to do LabVIEW Vision, largely by writing simple little VIs (no Express VIs, please) to "learn the Tricks of the Trade". Know any colleagues who have do visual processing (even non-LabVIEW -- image processing, with at least 4 dimensions to keep in mind (image width, height, the pixel value, and if video, "time" = Frame Number).
Bob Schor
01-23-2025 04:56 AM
And how can I write it over and over as video? by using while loop? I dont want to record every second of my experiment I want to add like start recording button but it seems a case structure is not a solution for that😑
01-23-2025 05:00 AM
Thank you for your answer, yes that part was easy and as you advised I made a vi for grab, it also works. Problem arises when I want to record a video with avi. The code that I have written dont produce a viode but a picture.
01-23-2025 08:16 AM
Solved: create vi was inside the loop. that was the problem.
thanks for answering
01-23-2025 11:28 AM