05-15-2017 06:40 PM
Hello,I have acquired the video using IMAQdx and now i'm asking how can i save this video on file,and how can i start and stop saving? thank you for answering me its urgent.
Solved! Go to Solution.
05-15-2017 08:33 PM
Well, I must confess I was going to say "Look at the Examples that come with LabVIEW", but they're (basically) terrible. So here's a walkthrough:
First, you need video Images, which (as you've noted) you can get with IMAQdx. You've already been introduced to the (poorly-explained, in my opinion) concept of the IMAQ Buffer, a data structure that holds the actual Image and is needed to move the image around. What you are going to do is open an AVI File, assign it to a particular Codec, and then write the Images one at a time to the AVI file until you're done, when you close the file. Most of the Functions I'll describe are in the Vision Utilities/Files sub-Palette.
Good luck. If you have any troubles carrying this out, attach your VI and someone will help you.
Bob Schor
05-16-2017 11:24 AM
Hi there,
Thanks for the great explanation, Bob. I just wanted to add, that if you plan to acquire AVI files that are over 2GB in size, you should use the IMAQ AVI functions instead of the IMAQ AVI2 functions. There is a 2GB limitation with the AVI2 functions that our team is aware of, but is not commonly known outside of NI. Just wanted to give a heads up in case you need files over 2GB!
05-16-2017 06:59 PM
Thank you for your answer it had really help me, this is what i did in the VI attached,i still have a problem that the video saved passed very quickly and not in its normal speed.
05-16-2017 08:58 PM
In AVI2 Create, you need to specify a Codec. I don't know what Codec is used if you leave it blank, but I tried your code and it did run fast. I used Motion JPEG (NI Vision), and it worked just fine, seemed to even have the correct timing. And was a factor of 10 smaller than the earlier file that ran "too fast". Try adding the Codec and see if it fixes your code.
Bob Schor
05-19-2017 06:11 AM
I didn't know how to create Motion JPEG in the codec,please if you can help me and modify this VI from me,thank you so much.
05-19-2017 06:11 AM
I didn't know how to create Motion JPEG in the codec,please if you can help me and modify this VI from me,thank you so much.
05-19-2017 09:13 AM
@Bob_Schor wrote:
In AVI2 Create, you need to specify a Codec. I don't know what Codec is used if you leave it blank, but I tried your code and it did run fast. I used Motion JPEG (NI Vision), and it worked just fine, seemed to even have the correct timing. And was a factor of 10 smaller than the earlier file that ran "too fast". Try adding the Codec and see if it fixes your code.
Bob Schor
Here is a picture that is your VI with the change I suggested in the above response:
Bob Schor
05-20-2017 11:35 AM
@touitou wrote:
I didn't know how to create Motion JPEG in the codec,please if you can help me and modify this VI from me,thank you so much.
Sorry, I'm "on the road" and didn't carefully read your question. There's a function on the AVI Palette called IMAQ AVI2 Get Codec Names that returns an Array of Strings. I simply chose (and exactly copied) the Motion JPEG string. On my system, this is the function and its result:
Bob Schor
06-29-2019 12:20 PM
@Bob_Schor wrote:
In AVI2 Create, you need to specify a Codec. I don't know what Codec is used if you leave it blank, but I tried your code and it did run fast. I used Motion JPEG (NI Vision), and it worked just fine, seemed to even have the correct timing. And was a factor of 10 smaller than the earlier file that ran "too fast". Try adding the Codec and see if it fixes your code.
Bob Schor
Hi, I have the same problem, I have tried using Motion JPEG (NI Vision) as it codec but the results are my video still too fast, do you have any advice?