Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-IMAQdx - My recorded videos are "accelerated"

Hello

 

I building a modular VI for a friction welding testing machine.

The communication between the VIs is done with queues and notifications. Part of my code is attached below.

 

One of the "sensors" of the machine is a USB-Câmera (Logitech HD Pro Webcam C920)

But when I record videos, they are "accelerated". Example: If I record 10 sec video, when I play it in VLC, the video have 8 sec (approximately)

 

I'm using the FF Video Codec 1 (FFV1) (NI Vision) to write a .avi file, here's the subVI that start the video and the VI that record:

subVI writeVideo2a.visubVI writeVideo2a.visubVI write Video2b.visubVI write Video2b.vi

 

These subVIs needs to be separated from the VI that is grabbing the camera image, because several VIs can record video.

 

How can I write a good compressed video without being a "accelerated one"?

0 Kudos
Message 1 of 4
(2,381 Views)

I've made a simplified version of my code, to testing purposes.VI that records a video from a USB CameraVI that records a video from a USB CameraBut still get the same problem, the timing of the videos are all wrong...

If I record 10 sec of video, the video file plays the same within 6-7 sec 

 

Have this ever happened with you? What can I do to solve this problem?

0 Kudos
Message 2 of 4
(2,337 Views)
Can you try with delay(1/30) in writing loop exactly with the fps(30) you are writing to the avi file?
Thanks
uday
Message 3 of 4
(2,319 Views)

@udka

 

I did what you suggested, but did not worked. The video continues being "accelerated". The delay did nothing 😞

 

What I've done to partially resolve the problem was change the codec from "FFV1" to "Motion JPEG (NI Vision)".

Now the videos are OK, but I think if other users try to use FFV1 codec they will be frustrated like I am now.

 

Here's my new code:

 

writeVideowriteVideo

Something that took me a while to find out was how to change de resolution of the camera:

You have to find the VideoMode enum code with the "IMAQdx Enumerate Video Modes.vi", them create a property node "VideoMode" with the correct number.IMAQdx Enumerate Video Modes.viIMAQdx Enumerate Video Modes.vi

 

Using NI Vision directly on LabVIEW should be easier, maybe NI can work in this module.

Because there's a lot of questions on "Machine Vision" without solution

0 Kudos
Message 4 of 4
(2,295 Views)