11-07-2006 09:38 AM
Hello,
I wondered if someone might be able to advise me on my options for compressing my .avi files to a more managable size. The application i want to use this code for will invovle recording an activity that will take up to 60 minutes. I will then likely have to spend many hours trawling through these, stopping, rewinding, fast-forwarding, etc.
I have experimented with a couple of the compression filters: 'MJPEG Compressor' doesn't seem to reduce the file size by much, although 'Indeo video 5.10 Compressor' does seem to be very effective. The problem with that is when I play the resulting file in media player, as well as reducing the file size it has also compressed 1 minutes worth of footage in to about 15 secs. Does this mean i need to do something to decompress the file before i view it?
I have my cameras set to 15 fps, and in 'IMAQ AVI Create' i have made sure that it creates at 15 fps, reduced the 'max data' down to 5000 and the 'quality' always seems to default to -1, even when i'm not using a filter. I can reduce the cameras to 7.5 fps in MAX, but for some reason the input to the 'IMAQ AVI Create' doesn't like me using a non-integer.
Could you please advise me: What are my options for reducing the file size, in a way that will not cause too much hassle when i want to sit and analyse the recordings?
Best regards,
Bruce
11-07-2006 10:29 AM
11-08-2006 03:40 AM
Hi Adam,
Thanks for that, I'll give it a shot this morning and report back.
Cheers
Bruce
11-08-2006 04:38 AM
Hi Adam,
I’ve tried replacing the while loop with a timed while loop (set with a period of 66ms, priority 100, and source 1kHz) and the result is pretty much the same – 1 minute’s footage played back over 15secs.
So, where do I find a millisecond counter? Where do I put it when I find one? And what exactly is it that I’m looking for?
When you said “the images are being sampled at a higher rate then the one you have set in MAX”…….which setting should I be looking at in MAX? Or are you just referring to the video mode? Anyway, my settings are:
Video Mode: 640x480 (Mono 😎 15.00fps
Speed: 200Mb
Timeout: 5000ms
In MAX, under the Camera Attributes tab, there is an option for frame rate which is set to ‘Manual (Relative)’ with a value of 0. Is this anything to do with the problem?
Apologies again for my lack of basic Labview knowledge!
Thanks
Bruce
11-08-2006 08:56 AM
11-08-2006 09:48 AM
Whoops, I guess that smaple file was too big to be uploaded.
Bruce
11-08-2006 04:51 PM
Hi Adam,
Sorry about that last message - i tried to upload an example of one of the .avi
files i've created for you to have a look at, but it must have been too big to
upload.
Anyway, i had a shot at making the change you suggested: removing the frames
per second input to the avi_create.vi (which i thought i had assigned as a
constant), and replacing it with a new constant containing "15" -
with no decimal point. I still got the same result. Also, what did
you mean by a "coersion dot"?
When you say you ran the code and it worked, do you mean that you got it to
record for, say 1 minute, and then play back for exactly the same amount of
time (1 minute)? If you did, does that not mean that the code is working
fine, and therefore there must be some problem with the way i've got my cameras
set up in MAX?
I have been playing the files in windows media player, and with nero showtime,
both of which give the same result. Do you think it could be the
player(s) that are the problem?
Thanks again for your help - hopefully i'll get this thing working soon!
Bruce
11-09-2006 05:46 AM
Hi Bruce,
Yes it does indeed work on my computer so the code is fine. The fact that it's not working on your machine could be a number of things.
Your computer could be too slow to record at that rate and therefore is only recording a frame once or twice a second (meaning that when it plays back you will get very quick playbacks)
The cameras could be set up incorrectly but the grab setup should be fine the way you have done it.
I would like you to try putting the period of the timed loop as 1000ms and the framerate of the AVI record as 1 frame pser second.
If this works then it's the speed of the computer that is the problem. They're aren't many ways around this as the computer is having to do a lot of processing each frame. (get size, change size of final image, place one image in final, place second image in final, then record frame to AVI (but convert the frame to Indeo format in the process)
My computer is a Dual core 2.13GHz with 2Gb of DDRRAM so I'm guessing it's pretty quick and this still has a few issues at 15fps.
Give the 1000ms period a go and get back to us?
Thanx
AdamB
11-09-2006 07:53 AM
Hi Adam,
Yeah, sounds like that might be the root of the problem. The machine has "AMD Athlon 64x2 Dual Core Processor 4800+ 984MHz, 2.00GB RAM".......see the attached screen shot, just in case i've misinterpreted the details.
I tried 1000ms at 1fps and it was fine. I tried a few other values, and through an iterative process found that 250ms at 4fps is probably the best i'm going to get.
I take it there's nothing else i can do? Should i just accept that the 4fps is the best i'm going to get? I'll maybe try going back to writing them as 2 different .avi's simultaneously and then concentrate ways of playing them back at the same time?
Let me know what you think
11-09-2006 08:22 AM - edited 11-09-2006 08:22 AM
Hmmm,
(Yeah my computer wasn't doing the combining of the images (as I only have one firewire camera at the moment))
Well we could 2 things! We could keep the joining of the images but write the file uncompressed. Then later on you could compress the file offline.
(like so)
OR
you could try saving them simultaniously (I think this wouldn't work as 2 simultanious access to the HDD would be slow) without either encoding or combining them and THEN adding them together and encoding in another vi?
Sorry but that's all I can think of at the moment. It does seem to be a processor power problem so I'm at a loss as what to do.
AdamB
Message Edited by AdamB on 11-09-2006 08:22 AM