View Full Version : ImageSource slow...
plonk420
21st November 2008, 14:48
is this an AVISynth issue or x264 issue? or user issue?
when i discovered --thread-input, it seemed to speed it up a bit, but now it seems slow again.
images (PNG) are no larger than 1.3mb each, but i'm only getting ~4fps on each pass. proc is at 30% (phenom x4).
i also could have sworn frameserving from VDub to x264 via Avisynth, i got 2 more FPS encoding...
any ideas?
if switches are necessary...
program --pass 2 --bitrate 400 --stats ".stats" --level 4.1 --ref 5 --mixed-refs --no-fast-pskip --bframes 5 --direct auto --subme 9 --trellis 1 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --me tesa --threads auto --thread-input --progress --no-dct-decimate --no-psnr --no-ssim --output "output" "input" --thread-input
edit: second pass is getting 5.3fps, and only 40% CPU usage
edit2: previous version i was using was either 998 or 857. currently using 1028-1 skystrife
roozhou
21st November 2008, 17:31
Disk read and PNG decoding should be the bottleneck.
And avisynth's built-in ImageSource and colorspace conversion are both slow and not multithreaded.
plonk420
21st November 2008, 23:49
Disk read and PNG decoding should be the bottleneck.
And avisynth's built-in ImageSource and colorspace conversion are both slow and not multithreaded.
wouldn't i see really small spikes in CPU usage if it was PNG decoding if that was the bottleneck? i'm not seeing any significant cpu usage anywhere other than x264.exe... so it's disk read, then?
Sagekilla
22nd November 2008, 00:24
The hard drive will be a bottleneck if the data is poorly organized. Any relatively recent disk will achieve ~80 MB/s read speeds, and maybe 50 - 60 MB/s when you're taking into account it's a mix of reading in images and writing x264 data. It's more likely the bottleneck is from your ImageSource. png doesn't exactly decode quickly, compared to a bmp or a jpg.
I'd say try another image read source filter. I'm not 100% sure but ImageReader(..) may be slightly faster. You can also try CoronaSource, see if that helps any.
Btw: This thread should probably be in avisynth thread next time as it's referring to ImageSource issues.
foxyshadis
22nd November 2008, 16:45
Try using multithreaded input (setmtmode(2) before imagesource, with MT dll).
Gavino
22nd November 2008, 20:09
How are you using ImageSource and what filters are you using?
You might find the use of Loop() will speed things up - see this post.
IanB
22nd November 2008, 23:04
Note: the DevIL library API used by ImageSource is NOT thread safe, it uses a single buffer.
Failure mode is one frame having contents from a conflicting frame.
plonk420
23rd November 2008, 11:43
only changefps and lanczos4resize...
a = ImageSource("I:\intothepink\picoStandAlone%04d.png", 0000, end = 9999, fps = 60) + ImageSource("I:\intothepink\picoStandAlone%05d.png", 10000, end = 23369, fps = 60)
b = wavsource("g:\picoStandAlone.wav")
audiodub(a,b)
crop(0,120,0,-120)
trim(37,0)
Changefps(30)
lanczos4resize(640,360)
ConvertToYV12()
i'm assuming i can tell avisynth to only read every other image, but i don't THINK i'm running into a decoding bottleneck...
Gavino
23rd November 2008, 16:55
Now that you've posted your script, I can see that my suggestion of Loop() won't help, because you don't have just a repeated static image.
The bottleneck might simply be the resize if your images are very large. If that's the case, you could try a simple BilinearResize, or ReduceBy2 one or more times before the final Lanczos.
But if the bottleneck is ImageReader itself, you're probably stuffed. :(
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.