comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: avi writing ? (xsize)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: avi writing ? (xsize) [message #40009] Wed, 07 July 2004 08:33 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Haje Korth writes:

> you are lucky you are getting garbage. When I tried experimenting with the
> VP3 codec, I got crashes all the time. It took me a while to notice that the
> size had to be a multiple of 16 (I believe). Afterwards no problem!

Are you sure? Mine had to be multiples of 32.

Cheers,

David

P.S. Just kidding. But I guess we have a *methodology*
here, at any rate. :-)

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: avi writing ? (xsize) [message #40010 is a reply to message #40009] Wed, 07 July 2004 07:56 Go to previous messageGo to next message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Bob,
you are lucky you are getting garbage. When I tried experimenting with the
VP3 codec, I got crashes all the time. It took me a while to notice that the
size had to be a multiple of 16 (I believe). Afterwards no problem!

Haje


"R.G. Stockwell" <noemail@please.com> wrote in message
news:UiFFc.52$UH6.32485@news.uswest.net...
> I have a routine that creates avi using the IDLtoAVI.dll.
> Sometimes the resulting output is slnated in an odd manner,
> as if I had specified the wrong "xsize", and the image had
> wrapped around. So the resulting avi is garbage.
>
> For instance, an xsize=478 will result in this slanted output.
>
> What are the valid xsizes for building AVIs?
>
>
> Cheers,
> bob
>
>
Re: avi writing ? (xsize) [message #40017 is a reply to message #40010] Tue, 06 July 2004 15:33 Go to previous messageGo to next message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
R.G. Stockwell wrote:
> "Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message news:cc9t5r$2vg$1@newsreader.mailgate.org...
>
>> R.G. Stockwell wrote:
>
> ...
>
>>> What are the valid xsizes for building AVIs?
>>
>> It depends on the codec. Many require that both dimensions be multiples
>> of 2, some require multiples of 4. The latter works for all codecs I
>> have tried (and I have tried quite a few).
>>
>>
>> --
>> Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
>> m.hadfield@niwa.co.nz
>> National Institute for Water and Atmospheric Research (NIWA)
>
>
> Thanks Mark,
> i'll run some code to verify the factor of 4 in size, and it
> should be easy enough to code around. After I had seen that
> it was not a factor of 2 that was the problem, I hadn't thought
> that 4 would be the factor. I was guessing that is only came in
> typical screen sizes or something like that.

I believe it's mostly to do with the requirements of the compression
algorithm. These algorithms use mathematical techniques like discrete
cosine transform that tend to work in blocks of 2^n, where n is some
small integer.

You can see the requirements of each of the codecs installed on your
system with VirtualDub, a free AVI-writing program:

http://www.virtualdub.org/

Go to the "Select video compression" dialogue and scroll through.

After writing the reply above, I did just this and noticed that one of
the codecs that I've installed requires the width and height to be
multiples of 8. But the codec in question (ASLC) probably isn't on your
system. The one you're most likely to have trouble with is DivX, for
which width must be a multiple of 4 and height a multiple of 2.


--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: avi writing ? (xsize) [message #40018 is a reply to message #40017] Tue, 06 July 2004 09:09 Go to previous messageGo to next message
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
"Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message news:cc9t5r$2vg$1@newsreader.mailgate.org...
> R.G. Stockwell wrote:
...
>> What are the valid xsizes for building AVIs?
>
> It depends on the codec. Many require that both dimensions be multiples
> of 2, some require multiples of 4. The latter works for all codecs I
> have tried (and I have tried quite a few).
>
>
> --
> Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
> m.hadfield@niwa.co.nz
> National Institute for Water and Atmospheric Research (NIWA)

Thanks Mark,
i'll run some code to verify the factor of 4 in size, and it
should be easy enough to code around. After I had seen that
it was not a factor of 2 that was the problem, I hadn't thought
that 4 would be the factor. I was guessing that is only came in
typical screen sizes or something like that.

Cheers,
bob
Re: avi writing ? (xsize) [message #40026 is a reply to message #40018] Sun, 04 July 2004 14:34 Go to previous messageGo to next message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
R.G. Stockwell wrote:
> I have a routine that creates avi using the IDLtoAVI.dll.
> Sometimes the resulting output is slnated in an odd manner,
> as if I had specified the wrong "xsize", and the image had
> wrapped around. So the resulting avi is garbage.
>
> For instance, an xsize=478 will result in this slanted output.
>
> What are the valid xsizes for building AVIs?

It depends on the codec. Many require that both dimensions be multiples
of 2, some require multiples of 4. The latter works for all codecs I
have tried (and I have tried quite a few).


--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: avi writing ? (xsize) [message #40065 is a reply to message #40017] Sat, 10 July 2004 12:49 Go to previous message
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
"Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message news:ccf9bc$nk1$1@newsreader.mailgate.org...
> "Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message news:cc9t5r$2vg$1@newsreader.mailgate.org...
>
>> It depends on the codec. Many require that both dimensions be multiples
>> of 2, some require multiples of 4. The latter works for all codecs I
>> have tried (and I have tried quite a few).
>> Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
>> m.hadfield@niwa.co.nz
>> National Institute for Water and Atmospheric Research (NIWA)

Yes, the width has to be a multiple of 4. I just ran a loop of many
sizes to verify. Thanks!

Cheers,
bob
Re: avi writing ? (xsize) [message #40099 is a reply to message #40009] Wed, 07 July 2004 13:20 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
David,
you may well be right. I was just too lazy to look in my code and it really
does not matter. The noteworthy part of my message was that IDLtoAVI is
not fool proof and does crash IDL if not used properly. I don't know how
much this helps others, but then again this is a newsgroup.If I were a
genius with great ideas I would publish a book, just like you. :-)))

Cheers,
Haje

"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.1b55c5be6b722d669897c7@news.frii.com...
> Haje Korth writes:
>
>> you are lucky you are getting garbage. When I tried experimenting with
the
>> VP3 codec, I got crashes all the time. It took me a while to notice that
the
>> size had to be a multiple of 16 (I believe). Afterwards no problem!
>
> Are you sure? Mine had to be multiples of 32.
>
> Cheers,
>
> David
>
> P.S. Just kidding. But I guess we have a *methodology*
> here, at any rate. :-)
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: blank window pops up after exit xmovie
Next Topic: Re: blank window pops up after exit xmovie

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:56:00 PDT 2025

Total time taken to generate the page: 0.00516 seconds