LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I configure avi compression?

Hi,

I would like to use the IMAQ avi routines to write a video and like to be able to use
more sophisticated video codecs like for example the "Microsoft MPEG 4 VKI Codec V3".
These codecs normally need further information like datarate or compression smoothness.
Without these information normally pretty low quality standard settings are chosen.

Does anbody know how to specify further settings when writing an avi?

If this is not possible, does anbody know how to change video codec standard settings?

Thanks

Ronnn
0 Kudos
Message 1 of 10
(5,973 Views)
Use IMAQ AVI Get Filter Names to give you an array of filters (CODECs).  Select one filter (the array element) and pass it in as a filter to IMAQ AVI Create.  This will configure the compression routine used to build the AVI.
 
Matt
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 2 of 10
(5,960 Views)
Hi Matt,

thanks for your fast answer.

I have already written an avi with the IMAQ routines.
But I wonder how to set non standard video compression settings (for example a higher data rate or a lower VKI Setting for MPEG-4 V3).

Most video editing software like Premiere or VirtualDub normally allow the user  to set these codec specific parameters.
How can I do this when I write an avi with Labview?

Bye
Ronnn
0 Kudos
Message 3 of 10
(5,955 Views)

From IMAQ AVI Get Filter Names Help:

Finds the compatible AVI compression filters currently installed on the computer. Each filter has a different compression quality, compression size, and compression time.

So I think this means that if the CODEC is installed on your system then AVI Get Filter Names should be able to identify it as a usable compression engine.  If it doesn't find it then you may have to call tech support to see why it was not detected by LabVIEW.

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 4 of 10
(5,944 Views)
Hi Matt,

thanks again for your answer.
I think I still didn't explain my problem good enough.
Therefore I have attached a small sample program that uses the "Microsoft MPEG-4  VKI  Codec V3".
I got this codec name from the IMAQ AVI Get Filter Names routine.
The program writes a short video showing a rotating picture (standard WInXP background picture: autumn.jpg)
using the MPEG-4 V3 codec.

The quality of the video is not very good.
I think this is due to the fact that the "Microsoft MPEG-4  VKI  Codec V3" uses only its standard input parameters (settings).
These are on my computer according to VirtualDub: VKI Setting: 1.0 sec, Compression Control: 75% Crispness, DataRate 1500kBits/sec

The quality of the video can probably be increased a lot by choosing a higher DataRate like 4500kBits/sec.

"Microsoft MPEG-4  VKI  Codec V3" is not a standard codec on most computers, but all more sophisticated codecs
like DV Codecs or DivX etc. have additional parameters or settings.

Does anybody know, how  I can set these parameters with Labview in order to produce higher quality videos?

Bye
Ronnn



0 Kudos
Message 5 of 10
(5,937 Views)

I know this is going to sound obvious but did you try to set a value of 1000 for the quality pin on IMAQ AVI Create?  1000 should give you the best quality for that CODEC and you can dial down from there.

From Help: quality is the relative quality, from 0–1000, to use with the compression filter. Pass –1 for this parameter to use the default quality of the filter. Not all filters support using different qualities.

 

Hope this makes everything good,

Matt 

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 6 of 10
(5,929 Views)

Using Microsoft MPEG-4 Video Codec V2 it seems to ignore Quality and Max Data Size.  I have adjusted these in the past without an issue.  You may want to try a different CODEC.

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 7 of 10
(5,926 Views)
Hi Matt,

My IMAQ Avi Create routine doesn't have a quality pin.
Maybe you have a newer version. I have LabView 7.1 with IMAQ Vision June 2003 Edition.

I took again a look at the parameters VirtualDub offers for each codec.
There are three standard ones: Quality, Keyframes/sec and DataRate
Some Codecs have them, some have others and some have none.

The Microsoft MPEG-4  VKI  Codec V1-3 all don't have a quality parameter.
On my computer I saw that Microsoft H.261, Microsoft H.263,
Microsoft RLE, Microsoft Video 1, Cinepak Codec by Radius
and Intel Indeo Video R.3.2 offer the quality parameter. Maybe the quality pin works with this codecs on your computer.

I would really like to use one of the newer and better codecs
but I know that they all have more complicated additional parameters. 😞

Thanks anyway for your help

Bye
Ronnn

0 Kudos
Message 8 of 10
(5,922 Views)

Per MAX I am running:

Vision 7.1.1

Image Processing 7.1.1.4004 And Services 7.1.1.948

See attached image from Create AVI Help

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 9 of 10
(5,913 Views)
Hi Matt,

thanks for your image. My IMAQ AVI Create help doesn't show this quality pin.

My versions seems to be slightly lower than yours:
per MAX I am running Image Processing and Machine Vision Library 7.0.1.187 and  Images Services Library 7.0.1.176.
Maybe I can make an update.

But this is unfortunately not solving my problem.

Bye
Christian
0 Kudos
Message 10 of 10
(5,896 Views)