View Full Version : Whats the maximum width in avisynth?
hanfrunz
20th February 2009, 16:03
I'd like to generate a ~30 minute crawl title with a list of names scrolling from right to left. My idea is to create a very, very wide clip (lenght=1 frame), then use subtitle() + animate or the crop function of a resizer to let it move. My feeling tells me that this won't work, because of the long text and/or a limitation of widht. What are the maximum values for that?
P.S. i'll try it anyway, but would be nice to know of any limitations
hanfrunz
IanB
20th February 2009, 22:07
Okay from an Avisynth internals perspective Pitch*Height has to fit within the range of an int, 32 bit signed. Pitch being aligned up Width. Apart from that of course you have to be able to malloc several instances of a VFB to hold the images, so there are 2Gb address space considerations along with all the other data and code currently loaded.
From a SubTitle() function perspective it has an array, alpha_calcs = new unsigned short[width*height*4], and does a Windows CreateDIBSection() with a size of bih.biWidth=width*8+32; and b.bih.biHeight=height*8+32; so again something will need to fit into an int somewhere. Just testing SubTitle chokes out at 4092, so there must be some internal windows GDI structure limits that relate to using signed 16 bit numbers. I could resize the result upto 32768 no problems.
mikeytown2
22nd February 2009, 10:47
I'd like to generate a ~30 minute crawl title with a list of names scrolling from right to left. My idea is to create a very, very wide clip (lenght=1 frame), then use subtitle() + animate or the crop function of a resizer to let it move.
KenBurnsEffect is the "easy" way to do this.
http://forum.doom9.org/showthread.php?t=135776
Width=640
Height=480
Length=round(30*60*29.97)
ImageReader("LargeImage.jpg",0,0,pixel_type="RGB32")
Loop(Length)
KenBurnsEffect(StartAlign=6,EndAlign=4, Width=Width, Height=Height)
hanfrunz
23rd February 2009, 08:46
Thanks to both of you. Does anybody know how i could generate a subtitle that is wider than 4092? Are there other GDI or whatever functions to do it. Or is there an external lib to generate text (maybe image magick?) I could then write a new textgeneration-filter.
hanfrunz
IanB
23rd February 2009, 11:08
StackHorizontal()
Leak
23rd February 2009, 12:19
Or is there an external lib to generate text (maybe image magick?) I could then write a new textgeneration-filter.
GIMP + it's scripting capabilities?
Or maybe just create a very wide image and add a few text layers?
hanfrunz
23rd February 2009, 14:08
I'd like to produce the crawl automated. Until no we use Adobe Premiere, copy paste the text and render, export to DVD. If i can produce the crawl with avisynth i could script the whole process :)
StackHorizontal() is not an option then. GIMP is worth a try.
Leak
23rd February 2009, 15:03
If i can produce the crawl with avisynth i could script the whole process :)
KenBurnsEffect pans over a huge image. Try it. :)
np: Jello - Chamchimzee (Chamchimzee 12'')
hanfrunz
23rd February 2009, 16:16
@Leak: I know it can do it. But how do i generate this very wide image? My source is a textfile with about 24000 letters.
subtitle() is limited to ~4000pixels. And i can't use stackhorizontal(), because i don't know the width of the text before it is rendered and would get a lot of space every 4000 pixels.
I am just testing image magick, but don't have success for now...
EDIT:
i made some calculations. My image would be ~500000 pixels in width. Thats pretty wide :)
Leak
23rd February 2009, 17:43
@i made some calculations. My image would be ~500000 pixels in width. Thats pretty wide :)
Well, the maximum image width in GIMP is 262144 pixels, but I was able to create a 262144x100 pixel image with no problems - just how high do you want your letters to be anyway?
Still, if I really had to do this I'd just write a small .Net app to draw the scrolling text frame-by-frame into a Graphics object the size of the target frame then spit out every image into a numbered PNG file and just convert that into a video using, say, VirtualDub - dunno how easy it would be to encode directly from within .Net...
np: Sascha Funke - Summer Rain (Mango)
mikeytown2
23rd February 2009, 20:48
The time intensive, but easy on the logic side, would involve multiple small images or Subtitle() calls. Try it with 3 and scale up from there.
Edit: Option B
http://forum.doom9.org/showthread.php?t=138954
hanfrunz
24th February 2009, 16:56
Still, if I really had to do this I'd just write a small .Net app to draw the scrolling text frame-by-frame into a Graphics object the size of the target frame then spit out every image into a numbered PNG file and just convert that into a video using, say, VirtualDub - dunno how easy it would be to encode directly from within .Net...
Mmmh but then you can move your text only in one-pixel-steps. I'd like to use the ability to move in-sub-pixel-steps with the avisynth resizers (you can use float values to crop within the resizers). So actually my idea is to split my text in parts (let's say 10000 byte) then i generate a few bitmaps.
To do that i would need subtitle() to crop the image to the exact width of the text, is this possible somehow? I tried autocrop, but it only works in YUY2 and sometime crops to a invalid framesize (not mod4). Any further advise would be great. thanks
Leak
24th February 2009, 17:36
Mmmh but then you can move your text only in one-pixel-steps.
Are you sure? As long as you render antialiased text it should also do sub-pixel positioning - at least that's what it did when I last used those functions to draw bar- and line-charts for a web app...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.