LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Video- real-time playback

I'm trying to record a video and play it back in "real-time". The recording process using the "Get Date/Time.vi" and Image "AVI Write Frame.vi" to capture a frame and write a correlating time to the frame in a spreadsheet (no delay in this loop). The playback opens the the avi file/spreadsheet (Vid Fig1, red box on left) then starts a millsec counter (Vid Fig 1, red box on right). Next, it displays an image/frame to the front panel (Vid Fig2). Finally, there's the failed attemp of creating "real-time" by adding a delay (Vid Fig3). The delay does slow the video playback  down, but playback still faster than real time. If you can make any sense of the code and give me any pointer, it'd be greatly appreciated.
Download All
0 Kudos
Message 1 of 6
(3,940 Views)
Hello WEvans,

The Wait Until Next ms Multiple function may be a better choice for synchronizing the AVI playback.  If we let x represent the number of frames per second, then you could wire 1000/x to the millisecond multiple input of the Wait Until Next ms Multiple function and place this function in a loop with IMAQ AVI Read Frame.  If the AVI has four frames per second, then this loop will iterate every quarter of a second.

Best Regards,
T. McCarty
0 Kudos
Message 2 of 6
(3,903 Views)
After further research, I realized its not necessarily the delay loop that is hindering my real time playback but the "IMAQ AVI Create.vi". The "IMAQ AVI Create.vi" requires data to be recorded at a particular "frames per second" which will affect the playback of the video depending on the computer's processor's speed. So how can I either record and have REALTIME playback regardless of the processor's speed or use the "frames per second" and create a delay in the playback such that it will be in realtime?
0 Kudos
Message 3 of 6
(3,827 Views)

Hello,

Are you using any type of compression when you first create the AVI?  Also, if you are using high frame rates on the PC, the frame rate may vary because of other programs running on the OS.  If you want it to be truly deterministic you will need to use a Real-Time OS.  Reducing frame rate, using a compression codec, and changing the size of the recorded image are ways to help keep the reliability off the specific processor.

Carlton
CLA
0 Kudos
Message 4 of 6
(3,794 Views)
Appreciate your help. I reduced the frame rate and was able to get the video playback very close to real-time. Do you, by chance, know if it is possible to download/run a labview program on a microcontroller (for example: a 68HC12)? If so, how may one go about doing so?"
0 Kudos
Message 5 of 6
(3,726 Views)
Hi,

It is possible to run LabVIEW on arbitrary microcontrollers, but the HC12 lacks the resources to run a typical LabVIEW application. The LabVIEW Microprocessor SDK can be used to bring LabVIEW support to 32-bit processors that have at least 256 KB of RAM. A kernel/operating system of some sort is also highly recommended.
--
Michael P
National Instruments
0 Kudos
Message 6 of 6
(3,704 Views)