LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adjusting time duration to read avi frames

Hello All,

 

Part 1) I am trying to read frames in avi file by adjusting the time duration i.e if the user enters a time duration,the program should run that many number of frames/images in that particular time duration. I should get a trimmed video for that particular time duration i.e sequence of frames/images. Instead,I am getting a particular frame/image number for that particulat time.

Part2) I am also reading the specific image/frame of the avi file by adjusting the frame numbers (successfully completed).

Can someone tell me what might be wrong in part 1

Any help or Information will be highly appreciated.

 

0 Kudos
Message 1 of 5
(2,700 Views)

@enthusiast4 wrote:

 

Can someone tell me what might be wrong in part 1


If you post some code, we don't have to speculate.

0 Kudos
Message 2 of 5
(2,675 Views)

The Code is attached below. Please let me know what I ma doing wrong. Is it because in Part 1 ,I am using IMAQ AVI Read Frame which only reads singhle Image,instead of multiple Images? I want the Images for a particulat time duration and not a single Image.

0 Kudos
Message 3 of 5
(2,657 Views)

I don't have IMAQ, but assuming there isn't already a function for reading multiple frames from an AVI, presumably you just need to call the Read Frame function multiple times?

0 Kudos
Message 4 of 5
(2,629 Views)

Forgive me, but I find it somewhat painful to try to figure out what you are trying to do with your code.  In your other recent post with a similar question/topic, I posted simple code that read a series of AVI frames (actually, it read all of the frames, but as you, yourself, pointed out, if you know the Frame Rate (which you do), and know the desired Start Time and Stop Time, you can transform this to "Start Frame" and "Stop Frame", and change my For Loop that runs through all of the Frames with a While Loop that is initialized by Start Frame, stopped at End Frame, and increments the Current Frame each time through the loop.  Couple this with the Timer that I used and you have (in simple code, easy to understand and debug, and without using an Express VI for the Video functions) the Solution to your Question.

 

Note that when recording Video, most Videos are acquired at a constant rate, set by the hardware in the Camera.  Some Cameras (we have some Axis cameras with this feature) can acquire Time Stamp information (via TCP/IP) from a Time Source, and can thereby put a Time Stamp on each frame.  One of my colleagues uses this feature, and I tend to yell at him about it -- he has yet to make use of those TimeStamps (except it is entertaining to watch them flicker at the top of the frame).

 

Bob Schor

0 Kudos
Message 5 of 5
(2,617 Views)