Re: avi writing ? (xsize) [message #40009] |
Wed, 07 July 2004 08:33  |
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 #40017 is a reply to message #40010] |
Tue, 06 July 2004 15:33   |
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 #40065 is a reply to message #40017] |
Sat, 10 July 2004 12:49  |
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  |
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/
|
|
|