Video acquisition framerate

Hello,
I've been trying to acquire images from a camera at 30 fps for time-sensitive image processing. Currently I have a while loop with imaq grab acquire wired to imaq avi write frame. The loop timing is controlled by a wait (ms) function. Obviously the framerate is dictated by the loop timing, which is my main problem. For 30 fps, it is 33.333333 ms per frame which causes a rounding error within the loop timing. Thus, I am getting more frames than I should because it is grabbing frames slightly faster than it should be.
I'm sure many others have solved this problem, but the solution is not apparent to me. So does anyone know how to properly control the framerate?
Thanks
-TJ
Solved!
Go to Solution.

TJ-
It looks like the bind you are in is because the OS (all PCs actually) and the camera only have a 1kHz clock, so you are stuck with 1ms intervals.  In software, there are always many ways so here you go:
Hack solution:
Vary the time of your delay loops:  33,33,34,33,33,34,...  This fixes your round off error, but will give you up to 0.6666ms dither in your signals.
Better hack solution:
Feedback to vary the time of your delay loops:  run a timer and use that to set the timing to either 33 or 34 depending on where your <1ms rounding error is at that particular time.
Expensive, best solution:
Get a camera you can set the timing in hardware.
Best solution with what you've got:
Get off of the windows 1ms timer.  The structure to use is a timed loop (under timed structures in the structures panel).  It will default to your Windows 1ms timer, but you can use any hardware timing you have.  One of your boards will likely have a 1MHz timer, which will improve your timing and dither issues by 1000x.  If you still need more, you can then use some of the hacks above.  
Ultimately this is a hardware problem and would be 'best' solved in hardware.  However, there are always lots of ways to do it.  In fact, I'm sure the NI gurus can come up with many more.
Best of luck.  Play around with these fixes and keep learning,
Casey

Similar Messages

  • Qosmio G10 Analog video acquisition.

    Please help!!!
    Does anybody can help me to find a way to run analog video acquisition on a Qosmio??
    I have to transfer many analog videos from a camcorder, I tried winDvd, Moviemaker, I installed Magic Video Deluxe, Pinnacle Studio 9 full version, but it seems that no one of these software is able to recognize and capture the video source. Only digital acquisition is OK. It is very frustrating!
    Many thanks
    Massimo

    I've had a similar problem with an anlogue VCR. I sorted that out by plugging the coax output into the TV-in socket using the coax adapter that comes with the Qosmio and then tuning the TV into the video. I was then able to record the video output just like any other TV programme. The recorded TV files are saved in the dvr-ms format and this can be imported into WinDVD Creator 2 provided you have a MPEG11 decoder installed.
    hth
    Les

  • Data+video acquisition + playback

    I would like to acquire video and data at the same time using 2 cards
    (image and data acquisition). Does anyone have a vi that will enable me
    to do this?
    I also want to look at the data and watch the corresponding bit of
    video, so does anyone have a vi to do this as well?
    Thanks
    Ali.
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    Jerome wrote in message news:<[email protected]>...
    > I have to realize video acquisition with a matrox marvel g450 eTv
    > video cards. I would like to know if someone can help me in the
    > realisation of such a vi in labview environnement, or in finding some
    > video acquisition examples
    >
    > thanks
    Is this an analog TV tuner? You may try my toolkit at:
    http://www.geocities.com/irene_he/IVision.html
    Let me know if it actually works.
    Irene

  • Video acquisition matrox marvel G450 eTV

    I have to realize video acquisition with a matrox marvel g450 eTv video cards. I would like to know if someone can help me in the realisation of such a vi in labview environnement, or in finding some video acquisition examples
    thanks

    Jerome wrote in message news:<[email protected]>...
    > I have to realize video acquisition with a matrox marvel g450 eTv
    > video cards. I would like to know if someone can help me in the
    > realisation of such a vi in labview environnement, or in finding some
    > video acquisition examples
    >
    > thanks
    Is this an analog TV tuner? You may try my toolkit at:
    http://www.geocities.com/irene_he/IVision.html
    Let me know if it actually works.
    Irene

  • Video acquisition from frame grabber

    I wanted to acquire image from a video camera which only has analog output. To do that, I used a framegrabber, called :"Hauppaugel analog video giditizer".
    However, as I can see from the list, the framegrabber provides image with YUY 2 format and in the list of my Labview vision module, I could not find such type.
    I have written a code for acquiring image which works fine with normal web cameras. however, when I want to use it for acquiring the image from frame grabber, it gives following errors:
    1. Error code: 1074396120 Not an image
    2. Error code: 1074396015 Cannot connect to camera, it may be in use.
    I guess it has something to do with the formats of the picture, but I really don't have experience with that. Could you help me out? The code is attached.
    I lookforward to your advice and thank you in advance for the help.
    Attachments:
    usb-acquire-avi22.vi ‏69 KB

    Hello,
    First, you have to know that your camera must be Direct Show, otherwise, you won't be able to use it in LabVIEW.
    If it is compatible, then you will be able to grab image using IMAQ USB, but keep in mind that this set of VI is no longer supported as IMAQdx is fully compatible with DirectShow cameras, and much better than IMAQ USB.
    Regards

  • Video Clip Framerate Wrong In Premiere

    So I have a super weird issue that I spent 2hrs trying to figure out last night, and am now here making a post. So I recorded a video of my iPad screen and audio which has a playback of 60FPS in Quicktime, VLC, or any other media viewer. But when I import into Adobe Premiere Pro (with the sequence set to 60FPS) it is EXTREMELY choppy; when doing a right click "properties" on the clip in premiere it says like 10.25FPS)
    Any idea of how to fix this? Thank you in advance!

    1 - moved to the correct forum
    2 - Exactly what is INSIDE the video you are editing?
    Codec & Format information, with 2 links inside for you to read http://forums.adobe.com/thread/1270588
    Report back with the codec details of your file, use the programs below... A screen shot works well to SHOW people what you are doing
    https://forums.adobe.com/thread/1070933 for screen shot instructions
    Free programs to get file information for PC/Mac http://mediaarea.net/en/MediaInfo/Download
    Does your video use a VARIABLE Frame Rate or a Constant Frame Rate?

  • Is there a way to get video acquisition for LabVIEW through the USB port?

    Using either the LabVIEW version 7 or lower versions.

    jeff au;
    You may want to check IVision for LabVIEW:
    http://www.geocities.com/irene_he/IVision.html
    Regards;
    Enrique
    www.vartortech.com

  • How to start and stop video acquisitio​n in a state machine

    hello,
    I'm a neuroscience student and here's what I'm trying to do: 1) trigger a GigE camera (200fps), 2) start video acquisition, 3) trigger a light that will stay on for x miliseconds, 4) trigger a valve that will blow an air puff, 5) stop the tone and the valve simultaneously and 5) stop the video acquisition 1second after 4). For that, my VI is a state machine, with a state for each trigger (ex, 1 state for trigger camera, 1 state for trigger light, ect) plus a state to "stop" and a state "time to wait". Everything was working except the video acquisition - the program would trigger the camera but only acquire one frame, because it wasn't running in a while loop and this is my first question: for a video acquisition is it always necessary to have a while loop?
    I assumed the answer was yes, so I built a "consumer" loop for the camera. Putting a queue in the state "trigger camera" in the producer loop, I was then able to start the video acquisition but now the problem is to stop it in the right time. I have another queue in the "stop" state in the producer loop, but it isn't able to start the "stop" state in the consumer loop, I think that may be because the consumer loop gets "stuck" in the while loop.
    I hope you can help me, the VI is attached. Thanks!
    Solved!
    Go to Solution.
    Attachments:
    trigger_cam.jpg ‏345 KB
    trigger_stop.jpg ‏354 KB
    Conditioning MS vi 2010.zip ‏68 KB

    Hi Gak,
    Thanks for the suggestions. I still didn't got it to work though. I moved the stop command to inside the while loop like you said but it didn't work. The problem seems to be in the communication between the producer/consumer loops. When I run the VI in highlight, the queue message "trigger camera" leaves the producer and arrives at the consumer loop in the appropriate time, starting the "trigger camera" state of the case structure. However, the message "stop" doesn't seem to be sent by the producer loop, so the consumer doesn't receive a signal to start the "stop" state of the case structure. Can you think of anything I should change in the producer loop so that the second state (stop) is added to the queue?
    About the functional global, I read about it, it seems that either that or a local variable could work, but I don't quite know how to implement it in my state machine, since the stop of the first while loop isn't activated in the "stop" state but in the "shutdown" state. It works more or less like this: after 10 loops of triggering and stopping the camera, light and valve (so after acquiring 10 movies), it goes for shutdown. Can you show me what you had in mind with the functional variable?
    Attachments:
    Untitled.jpg ‏286 KB

  • Video Capabilities -- Confirming Current Limitations (Record + Higher Quality Than Sorenson)

    Hi,
    Regarding video with Cocomo, I writing to confirm that the
    current version does not provide the following two capabilities:
    Recording. Acrobat Connect Pro includes record capability.
    Am I correct that at this time Cocomo does not (yet) include record
    capability?
    Video Encoding. Am I correct that at this time Cocomo
    supports only Sorenson Spark for acquisition of live video?
    (Background: I have two clients seeking integrated video and text
    chat applications with higher quality video for the primary
    presenter. Flash Player supports playback of video encoded in
    Sorenson Spark, On2 VP6, and H.264. For encoding of live video,
    Flash Player (and by extension Cocomo) encodes only Sorenson Spark.
    Adobe does, however, also support via the Flash Media Live Encoder
    (FMLE) live encoding using VP6 and H.264. I assume that Cocomo
    currently does not support integration with FMLE or any other
    option for higher quality live video acquisition)
    Thanks again for your support and this great new
    product/service.
    I look forward to Cocomo having its official commercial
    release here in 2009! :-)
    Best regards,
    g

    Hi Nigel,
    Thank you for your reply.
    Regarding the use cases ...
    1) Union For Regular Member Meetings.
    2) Pharmaceutical Training.
    The first has looked at Connect Pro and the second currently
    is using Connect Pro. Both cases seek both a higher quality video
    for the presenter as well as to be able to record (for archive and
    for "re-airing" by those unable to join live).
    Regarding additional encoder in the presenter's "Player", I
    think if just AIR could encode H.264 these client's use cases would
    be satisfied. (These clients' goal on video quality fits a
    1-to-many pattern. Requiring the presenter only to install AIR
    seems a reasonably unobtrusive solution. Then, should attendee
    video also be required, Sorenson via Flash Player should suffice.)
    For both clients, having the hosted service from Adobe is
    also an attraction (depending on pricing ;-)
    Again, thanks for the great work of your team and everyone at
    Adobe for bringing these solutions to the market.
    Best regards,
    g

  • Video Playback Issues after Downloading iTunes 10.4.1 & Quicktime

    After downloading v. 10.4.1, video playback framerate is terrible. Voices are choppy & out of sync with dialogue. The music wasn't necessarily affected but, can here slight distortion. This hasn't been an issue until downloading the latest software version. Then iTunes crashes. Am I the only one this is happening to?

    You may consider updating your iTunes to the latest version to fix bugs.
    Download iTunes

  • Problems with video in Flash Projector?

    We are looking for guidance on how to overcome horizontal tearing in parts of .F4v movies played out of
    Flash projector for PC.  We suspect the problem crops up at the point the projector is generated out of Flash,
    having experienced the same problem with .F4Vs generated by others (see Note re: David Hassoun's Adobe
    online article below).
    The Problem:  .F4V movies played out of a Flash projector exhibits horizontal tears (artifacts) during
    panning, zooming motions in the video.
    The Project:  Interactive kiosks for Hyatt/SeaWorld employing two screens -- a touchscreen and
    media/display screen.  The project stage spans the two monitors (2390 px X 768 px combined) with the
    touchscreen portion occupying 1024 and display screen 1366 of the horizontal dimension.  The videos in the
    media screen (an attract loop and separate movies selected via the touch panel) have been encoded with
    Adobe Media Encoder as 1280x720 .F4V files.
    The Workflow:   Video acquisition in HDV, captured by Final Cut Pro and converted/uprezzed to ProRes 422
    for editing.  Rendered out at "Current Settings" resulting in a 1920x1080i QuickTime - ProRes codec movie.
    That is encoded to .F4V in Adobe Media Encoder using the 720p preset. We then use a program called
    Jugglor to position the full-screen project, stripping off borders and hiding the system bar.
    Movies play normally in Adobe Media Player and in .swf files generated out of Flash.  But after creating a
    Flash projector for PC, the video exhibits the glitches (horizonal tears) in pans and zooms.
    The Playback PC:  The media is played out of a custom-built PC consisting of:
    - Gigabyte motherboard, Intel Chipset 58
    - 6 gigs of ram
    - i7 Intel process (quad core) @ 2.66 gb
    - NVidia GeForce 9500 GT video card w 1gb ram
    - Super Ram Disk playback
    - 1 TB SEagate 7200 RPM HD w 32 mb cache
    - 550 w Corsair power supply
    Note:  We have downloaded and played some example H.264 videos accompanying David Hassoun's
    "Exploring Flash Player Support for H.264 Video and AAC audio" from the Adobe website.  We noted that
    the video viles played flawlessly in the QuickTime player, but when we brought them into Flash and
    generated a projector file, we saw the same horizontal tearing, particularly in motion shots and in
    transitions.

    I hope this is something Adobe is looking into.  There are lots of tutorials for making videos small and grainy for playback on phones and internet appliances, but very little in the way of guidance for making hi-def video look like hi-def video.
    A modern PC should be able to play hi-def off the hard drive with no problems, and there are players that do this (Quicktime, WMP, Nero), but when H.264 gets walled up inside a flash player, it seems to bog down.  The machine described above will easily decode and play back DV video in WMP at 25 Mbs, but both the Flash Player and Adobe Media Player give no joy when trying to playback h.264 at much lower bandwidths.
    Increasing the quality of the video compression doesn't seem to overtax the processor or the bus (since it plays well in other players), but in Flash Player, it seems to expose limits in the performance of the player.
    For authoring in Flash, what is the recipe for decent Hi-def?

  • Problem w/ Case Statement and Video Capture

    Hey!
    I've got a question about a topic which seems pretty trivial, but has been giving me quite the trouble for some time now. I was hoping that someone on this forum would be able to help me catch and fix my mistake.
    Basically what I'm trying to do is capture video from a camera, run some video analysis for a certain duration, and store the raw footage for that same duration in an avi file. I'm using IMAQdx and a Logitech C920 camera to gather video. When I run the program, I want there to be an output of the raw video on the front panel. When I then hit a button, I would like the camera to save a .avi file of the video for a set number of frames and concurrently run some analysis and display the results on another display on the front panel. The purpose of the raw footage in the .avi file is to be able to run the analysis again at a later date.
    I've attached both a screenshot and the .vi file to this post. When I run the current script, I'm confronted with one of two possible errors (not sure why they're different from time to time). The Video Acquisition Block either "Time Out"s or the Write to AVI block issues an incompatible image type error. The reason why I'm baffled by this is because when I take it out of the case statement and have it run with the rest of the program, the .avi file is generated accurately and stored.
    Any help would be greatly appreciated. Thanks!
    Attachments:
    Script Image.png ‏39 KB
    11_30_12 TrackVIEW.vi ‏271 KB

    Greetings, 
    Would the time out error happen every time you run the VI? In addition, do these errors have a code?
    I was able to replicate the issue and initially believe that it might be that we are simultaneously opening two sessions to the same camera. Could you simply take a finite number of images from the first acquisition and chain the second one via sequence structure? It would limit the viewer to only view the video on the other Image Display during saving the AVI, but it might be worthwhile looking into. 
    It might also be worthwhile to consider enquewing a certain number of images whenever the button is pressed, but that would require some more programming logic.
    Cordially;
    Simon P.
    National Instruments
    Applications Engineer

  • Screen video capture with VLC command lines

    Hi,
    I need to do a program in LabVIEW that saves a video of my screen. I want it to open VLC by sending a command line and then start/stop the acquisition when I press a button. How could I do that? I didn't find the command lines to tell VLC to start the screen video acquisition... Can anyone help me and tell me what should I write in the command lines? Thanks for help!!

    Look up the help on the command line program then use the system exec to run that.  I'd start by figuring out what you need to do with an empty command prompt to play with.
    Also I've seen others do this same thing using ActiveX which VLC installs.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Dv video time stamp with analog input

    Hi,
    I have a dv video which I want to time stamp with a analog input.  For the video, which is dv brought into the computer with ieee1394, LabView calls up a C++ program which then stores the video.  Simultaneously, in the program which calls up the C++, an analog signal is also stored (seperately).  I know it sounds tricky as well as messy but this is the best we've been able to work out, given the uncorroperative nature of LabView with dv camera.  Does anyone have suggections for time stamping these two signals so that I know exactly where in the video the analog signal occurs?  The PCI board we use is the NI 6014, which I know is timestamp capable, but I dont know if it can stamp the video feed since it doesnt come in through the NI card.
    All thanks in advance for any help!
    Daniel

    Daniel,
    Does your DV camera have any sort of timing or triggering signals? Without these, it will be virtually impossible to correlate measurements. It is cetainly possible to accurately time an analog input with your DAQ card, but correlating these to the digital video would be extremely difficult. Is this video streaming in real time? Or are you reading it off of an already-recorded tape? If this video is streaming in real time, with an acquisition started in software, I would suggest attempting to start the software DV reading at the same time as your DAQ task. If you do have an external signal that can trigger the video acquisition, then I would suggest using that same signal to start your analog acquisition.
    Hope this helps,
    Ryan Verret
    Product Marketing Engineer
    Signal Generators
    National Instruments

  • Nearly Happy - video to iPod

    Hi Now I can come close to what I want.
    BUT
    My imported DVD results in
    - a BW/W picture on my TV and
    - picture + sound looks like a lots of drop-outs
    Not very good
    BW/W I thought was a NTSC / PAL problem so I cahanged frame rate to 25 fps
    Chequed the iPod but it was set to PAL
    My settings in HandBrake (0.7.0) is as follows:
    File Format MP4 file
    MPEG-4 Video / AAC Audio
    Subtitle:
    Language: None
    Audio:
    Unknown (LPCM)
    None
    48000
    160
    Source
    Video:
    framerate (fps): 25
    Encoder: FFmpeg
    Quality
    Target size (MB): 700 dimed
    Average bitrate (kbps): 1000
    and 2-pass encoding
    Picture setting: 480 x 368
    Anything more that I can select ??
    Can I do it in another way ??
    Yours Bengt W

    Go to this helpful link.
    http://howto.diveintomark.org/ipod-dvd-ripping-guide/
    Audio:
    Unknown (LPCM)
    None
    48000
    160--------Why are you using these setting for Audio?
    Try Language 1---ENGLISH (MPEG"
    and Lnaguage 2---NONE
    Video:
    framerate (fps): 25
    Encoder: FFmpeg
    Quality
    Target size (MB): 700 dimed
    Average bitrate (kbps): 1000
    and 2-pass encoding-----You might want to try these setting for Video.
    FRAMERATE(fps)---Same As Source
    ENCODER---264 (First select AVC/H.264 VIDEO under Destination/Codecs)
    QUALITY---Target size=700 Average Bitrate (kbps) 600
    Constant Quality---Click it and slide bar to 90%
    and 2-pass encoding---For the iPod, you really don't need this setting.
    Picture setting: 480 x 368---Use 320 for iPod.
    Try the link I gave you, it should help you.
    Good Luck=have fun.........DRL

Maybe you are looking for

  • How to use FM CRM_ORDER_READ using only object_id(sales doc)

    Hello Experts, I need to get the details for a given sales document in CRM(crmd_orderadm_h-object_id). I want to use FM CRM_ORDER_READ to get the details of a sales doc but my problem is where to put the object_id value. ANy simple example would be h

  • How can I add a sequence in one project to a sequence in another project?

    I have finished editing a project called "HF Field Day 2011" but want to add another finished sequence from another project called "Quick pitch tent" at the end of the video in the former project. I then want to render the combination out to a final

  • No administrator found for the task error message

    Dear all, I got the message "No administrator found for the task" when the MSS user try to approve and overtime. When i double click on the error for details, it actually give WF notification:work item cannot be executed message no. 5W141. As got ove

  • Sending message while order get Pending Status

    Hi, We r  using status profile for releasing order. If order fails the condition, it remains in the Pending Status. So we need to send these order to Sales Rep for review. How to send email to Sales Rep?

  • SQL 2012 SP1 fails to complete, Repair Install fails

    Somewhere, SQL 2012 stopped running.  This is developer copy.  I believe also that SP1 was trying to install and found that SQL Engine was not running.  In attempts to repair, I use the DVD and the repair process.   But that stalls/dies because SP1 i