LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AVI with desired frame rate

Hello! I am trying to play AVI file with user defined frame rate. I have tried it using 'Timed loop' by specifying the time period, which can play the video at the desired frame rate/speed. But, no matter what frame rate the user enters, it is running at the original frame rate. I have attached below the part of my code for this task.

Can someone tell me what is the problem here using timed loop or any other way out?

Any help will be highly appreciated.

0 Kudos
Message 1 of 16
(3,365 Views)

Hi enthusiast,

 

what's the point of that TWL here?

You still play the AVI in the inner FOR loop!

You even programmed (and commented) to stop the TWL right after the first iteration: there's no sense to set an iteration rate (aka dt) then!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(3,352 Views)

The stopped the timed Loop after 1st iteration in order to run the video only once. Otherwise, the video was repeatedly playing and was not stopping. I tried to play the video faster or with any desired rate using the timed Loop. But, unfortunately it is not happening and I am not understanding what is wrong with it. I have tried to follow the concept from the attached code (this code was posted to the labVIEW forum by a different memeber)

0 Kudos
Message 3 of 16
(3,346 Views)

Hi enthusiast,

 

I tried to play the video faster or with any desired rate using the timed Loop. But, unfortunately it is not happening and I am not understanding what is wrong with it.

You're not understanding: the loop rate of the TWL does NOT determine the playrate of the AVI!

The frame rate of the AVI is determined by the inner FOR loop…

THINK DATAFLOW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 16
(3,330 Views)

Then what is determining the playrate of AVI in the attached code? Just by varying the 'desired frame rate' control , the AVI plays faster or slower . This is what I experienced by running the AVI. Also, how to manipulate the FOR Loop in order to play a Video in the desired Frame rate?

PS: Forgive me, but I am a beginner in learning labVIEW

0 Kudos
Message 5 of 16
(3,321 Views)

Hi enthusiast,

 

what is determining the playrate of AVI in the attached code?

Your hardware. The FOR loop will run as fast as it can…

 

how to manipulate the FOR Loop in order to play a Video in the desired Frame rate?

Get rid of that TWL loop and put a wait function inside the FOR loop…

 

Forgive me, but I am a beginner in learning labVIEW

Did you take those free resources to learn LabVIEW?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 16
(3,314 Views)

May be like the attached image? But, how to make it user defined frame rate using simply a wait function in the for loop. I have gone through the following posts by which I learned that using timed loops can increase the sampling rate:

https://forums.ni.com/t5/LabVIEW/How-to-increase-sampling-rate-with-my-LabView/td-p/3615896

https://forums.ni.com/t5/LabVIEW/increasing-sample-rates/td-p/941381

 

 

0 Kudos
Message 7 of 16
(3,310 Views)

Hi enthusiast,

 

how to make it user defined frame rate using simply a wait function in the for loop.

The same way as you tried with the TWL: wire a calculated value to the wait function…

 

I learned that using timed loops can increase the sampling rate:

How does a TWL increase a sample rate???

All they do is to iterate at a certain rate, they do not execute contained code faster on their own…

 

Side note: It might be easier to control tools like VLC remotely…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 16
(3,304 Views)

I used Windows media player (ActiveX) a few year ago.  I was able to tweak the frame rate a few % faster.

 

George Zou
0 Kudos
Message 9 of 16
(3,297 Views)

@enthusiast4 wrote:

May be like the attached image?


First of all, please do not attach Images.  Attach VIs, something we can Run, Edit, Modify, etc.

 

Second, yes, exactly like the attached Image, which you asked to play at 500 FPS (which it will do its very best to do).  Try wiring 100 into the Delay -- you'll get 10 FPS.  With 33, you get 30 FPS.  [I forget with what "You get Eggrolls" ...].

 

Bob Schor

 

P.S. -- if you haven't learned enough LabVIEW in class to do these exercises, then certainly take advantage of the suggested Tutorials on the Forum Website.  You need to do more than just look at them -- you should try to reconstruct all of the steps they discuss and show, and make other "programs/problems" for yourself.  Schor's Rule:  The Only Way To Learn Programming Is To Write Programs.

 

Bob Schor

 

0 Kudos
Message 10 of 16
(3,288 Views)