Jump to content

video playback


aka

Recommended Posts

hi,

is there a function in LAbview 6,7 or 8 to playback a video file (.avi , .mpeg)? or do i need to get the IVision toolkit?

ideally i would like to have a video function that handles both image and audio. is that possible? or will i need to extract the audio and then synchronise an audio and a video function to play simultaneously?

thanks,

alex

Link to comment
  • 2 weeks later...

QUOTE(MikaelH @ Nov 18 2007, 09:46 PM)

thanks for the reply,

i tried using the Windows Media Player and the problem i'm having is that the playback is not very smooth, it kind of 'jumps' frames while it is loading the .avi . i dont think this is a labview problem because i have the exact same behaviour when opening the same .avi with windows media player running as an independent application. with other programs like DivX this is not an issue and everything runs just fine. by the way this happens with both WMP 9 and 11 on a pentium III 800MHz PC with 512 Mbytes RAM and running XP professional with sp2.

i have tried also a different approach which is to use IMAQ AVI open.vi and IMAQ AVI read frame.vi. i have attached a pic of the code. the problem with this is that the playback is slow. meaning that the time it takes to update each frame is too long. i can not see why because i read the number of frames in the .avi file and then set a delay according to that. however i have seen that the time delay is not accurate. so for example if i dont read the frame rate from the .avi but hard code say 2 frames per second then it works. if i say 4 frames/sec then i see about 2.5 frames per second. if a say 1000 frames/sec the speed is not faster than 25 frames/sec.

has anyone experienced the same?

thanks

alex

Link to comment

QUOTE(aka @ Dec 2 2007, 08:49 PM)

the problem with this is that the playback is slow. meaning that the time it takes to update each frame is too long. i can not see why because i read the number of frames in the .avi file and then set a delay according to that. however i have seen that the time delay is not accurate. so for example if i dont read the frame rate from the .avi but hard code say 2 frames per second then it works. if i say 4 frames/sec then i see about 2.5 frames per second. if a say 1000 frames/sec the speed is not faster than 25 frames/sec.
Hi Alex,

the delay you are using adds up to the time LV needs to read (and draw) the frame,

so it is better to use the metronome (Wait Until Next ms Multiple).

As far as I understand your last test, 25 frames/sec is the fastest speed you can process your frames,

if you want to go faster, for e.g. an avi with a framerate of 50 fps, you could set the fps to 25

and the skip every other frame to keek the timing intact.

Good luck,

TNT

Link to comment

QUOTE(tnt @ Dec 3 2007, 09:24 AM)

Hi Alex,

the delay you are using adds up to the time LV needs to read (and draw) the frame,

so it is better to use the metronome (Wait Until Next ms Multiple).

As far as I understand your last test, 25 frames/sec is the fastest speed you can process your frames,

if you want to go faster, for e.g. an avi with a framerate of 50 fps, you could set the fps to 25

and the skip every other frame to keek the timing intact.

Good luck,

TNT

thanks for the reply,

i understand that i'm adding an extra delay but its purpose is to automatically detect and display the correct number of frames/sec. reducing this delay should as you say make it faster but then i will not be showing the video at the correct speed (meaning the speed of the real event that was recorded). also i guess that the time labview takes to read , display and delete each frame should be less than a millisecond.

alex

Link to comment

Hi Alex,

just forget I ever wrote the last 3 lines of my previous post,

just re-read the first 2 lines and

REPLACE the "Time Delay" with the "Wait Until Next ms Multiple.vi" in your "Play video ... .vi".

In this way EVERY loop will take 1/fps time to complete (as you requested).

(Unless LV requires more time than specified and the loop-rate will decrease to >= 2* 1/fps

and this is what I was talking about in my last 3 lines.)

Happy testing...

TNT

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.