VideoHelp Forum
+ Reply to Thread
Results 1 to 29 of 29
Thread
  1. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    x264 --threads 4 --ref 1 --scenecut 0 --nf --no-cabac --bframes 0 --partitions none --no-8x8dct --me dia --subme 0 --aq-mode 0 --crf 32 --output out.mp4 a.avs
    content of a.avs:
    LoadPlugin("C:\MEGUI\tools\ffms\ffms2.dll")
    FFVideoSource("c:\source.avi", threads=4)
    LoadPlugin("C:\AVISYNTH\plugins\RemapFrames.dll")
    LoadPlugin("C:\AVISYNTH\plugins\EffectsMany.dll")
    LoadPlugin("C:\AVISYNTH\plugins\zoom.dll")
    a1=last
    a2=ImageSource("d:\watermark.png",pixel_type="RGB3 2")
    a3=Overlay(a1,a2,mask=a2.ShowAlpha())
    ReplaceFramesSimple(last, a3, mappings="[ 0 479 ]")

    i use x264 version 0.155.2901
    i use avisynth version 2.6
    any idea if i can get more fps speed?
    why cpu utilization only about 35 percent?
    i use old processor with passmark about 4000
    Last edited by dedekov; 15th Mar 2020 at 09:38.
    Quote Quote  
  2. Still using an e6600? I would expect more CPU usage than 33 percent. But try a multithreaded version of AviSynth -- AviSynth+. Then add prefetch(2) or 4 at the end of your script.
    Quote Quote  
  3. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    avisyth+ requrte xp3.....i cant use xp3 . now i use bxp (xp2)very fast..i know i can use mxp but please that window cannot execute text in pshop and i do alotwork in pshop so i just use still bxp .. anyway i have vitualbox but it will kill the speed.. how much i can gain if using avitynth+ with prefetch ??? 3times more faster / 3x more fps???anyway e6600 is 2core and i using q 4core
    Quote Quote  
  4. What are the properties of your source video? Frame size, video codec, etc. And how fast are you encoding now?
    Last edited by jagabo; 15th Mar 2020 at 06:58.
    Quote Quote  
  5. I just fired up an old dual core PC and installed AviSynth 2.6 32 bit. Using your script with a 480x360 Divx AVI file (via AviSource) and your x264 command lineI was getting 100 percent CPU usage and about 300 frames per second encoding. If your AVI file is uncompressed you may have a disk I/O bottleneck.
    Quote Quote  
  6. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    source is avi(1920x1080);mpeg 4(xvid) framerate 25 planar 4:2:0 yuv; the time to output to mp4 about (1.4xtotal running time on source)... source is 37mb with 47sec running time
    Quote Quote  
  7. remove this option --threads 4
    Quote Quote  
  8. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    without --threads 4 become more worse about 1.7xtime to finish than before
    Quote Quote  
  9. I recreated your situation as closely as I could: a dual core CPU (Athlon 2 X2 255, 3.1 Ghz) with a 24 fps 1920x1080 Xvid AVI file, your AviSynth script, single thread AviSynth 2.6, encoding with x264 and your settings, all under 32 bit Windows 7. I couldn't get ffVideoSource() working on that computer so I used AviSource() instead. Without any filtering (just AviSource) I got 100 percent CPU usage and encoding about 40 fps. Encoding the full script got me 100 percent CPU usage and about 37 fps. So the script itself didn't require much CPU. If I added ConvertToRGB32() right after AviSource() the process was much slower. Only 7 fps during the first 480 frames (the frames with the overlay) speeding up afterward -- for an overall encoding speed of 15 fps. I wounder if ffVideoSource() is putting out RGB instead of YV12 on your computer. Try adding Colorspace="YV12" to the ffVideoSource() filter and see if that speeds things up.
    Quote Quote  
  10. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    unfortunetly adding Colorspace="YV12" to ffvideosource not effecting total time/cpu utilization
    Quote Quote  
  11. x264 --threads 4 --ref 1 --scenecut 0 --nf --no-cabac --bframes 0 --partitions none --no-8x8dct --me dia --subme 0 --aq-mode 0 --crf 32 --output out.mp4
    I'm surprised no one has picked up on this, you will never get 100% cpu utilization with these options, I'm actually a bit surprised you are getting as high as you are, the settings you are using a the equivalent of the "ultra fast" preset, at the most, this preset is not very demanding at all.

    Instead try "x264 --preset superfast --crf 32 --output out.mp4" and you should see nearly 100% usage, it will be slower but higher quality.
    Quote Quote  
  12. Originally Posted by dedekov View Post
    unfortunetly adding Colorspace="YV12" to ffvideosource not effecting total time/cpu utilization
    Try removing all the filtering. Just import the source video and encode with your x264 settings. Do you get 100 percent CPU usage. If not, try using AviSource instead of ffVideoSource. Any difference?

    By the way, --crf 32 delivers terrible quality.
    Quote Quote  
  13. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    @sophisticles i just want convert with that crf as fast as possible
    @jagabo removing that make cpu utilization 87-91 percent .. cant try Avisource because:: avs [error]: Evaluate: System exception - Integer Divide by Zero
    Quote Quote  
  14. Originally Posted by dedekov View Post
    removing that make cpu utilization 87-91 percent ..
    So the AviSynth filtering is mostly responsible for the low CPU usage. Try just the source line and Info(). What does it say about the Colorspace?

    Originally Posted by dedekov View Post
    cant try Avisource because:: avs [error]: Evaluate: System exception - Integer Divide by Zero
    I don't know what would cause that. Not much to go on... Try a smaller (frame size) Divx AVI. Any different. Try (re)installing the Xvid codec.
    Quote Quote  
  15. One more thing to remember, just because a process is using 100% of your cpu doesn't mean it is doing it efficiently, many times one thread is waiting on another to finish and data is being ping-ponged back and forth.
    Quote Quote  
  16. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    @jagabo i get yv12
    Quote Quote  
  17. Originally Posted by dedekov View Post
    @jagabo i get yv12
    So ffVideoSource is working the same as on my computer. How big is your watermark image? The one I'm using is very small, only 110x22 pixels. A big one will probably be slower.
    Quote Quote  
  18. Maybe memory bottleneck? swapping to page file ? 2GB system memory is not a lot for 1920x1080 with avisynth and x264 encoding plus whatever you are running in the background
    Quote Quote  
  19. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    @jagabo 310x80px painted , other area is transparent , total size is 1920x1080px , png 18kByte size
    Quote Quote  
  20. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    @poisondeathray physical memory still available 2.4gb when x264 running and no other program is running
    Quote Quote  
  21. Your profile says "2 giga ram" , so I guess that's not updated
    Quote Quote  
  22. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    sory .. profile updated
    Quote Quote  
  23. 1) Not speed or optimization related - but overlay() in avisynth 2.6 x86 converts internally to YUV444, but it uses Rec601 by default. So your overlay might be slightly off in color for HD.


    2) mt_merge should be faster than overlay. (it's about 20-30% faster in avsmeter) for ST avisynth 2.6 here. But different CPU, maybe different SIMD , AVX2 etc... Worth a try

    Code:
    a3=mt_merge(a1,a2.ConvertToYV12(matrix="rec709"),a2.ShowAlpha("Y8"), luma=true)
    (I used rec709 in that example, that should be more correct for the overlay colors for HD)
    Quote Quote  
  24. And you can still use Set's avisynth classic 2.6 MT for multithreading on XP. On many scripts it can increase speed substantially. Some people still use it today instead of avs+ mt

    "1.4xtotal running time on source" is less than realtime. It seems like issue with script or your avisynth setup since you get "87-91 percent" by removing all filtering. So you should be able to benefit from avisynth classic MT , or mt_merge

    What was the FPS with that cpu%? FPS is more important than cpu%, because you can get high cpu% with thrashing and wasted CPU cycles - but LOW fps encoding. You should be more interested in encoding FPS, not CPU% .
    Quote Quote  
  25. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    avs [error]: Script error: there is no function named "mt_merge"
    fps variable between 17-27fps..at the start more lower than 17
    Quote Quote  
  26. Originally Posted by dedekov View Post
    @jagabo 310x80px painted , other area is transparent , total size is 1920x1080px , png 18kByte size
    That's probably your bottleneck. Crop the image down and overlay it where you want it.
    Quote Quote  
  27. Wait, I just saw your profile now says you have a Q9550. That's a quad core CPU not dual core.

    https://ark.intel.com/content/www/us/en/ark/products/33924/intel-core-2-quad-processor...3-mhz-fsb.html

    You should be running x264 with ~1.5x the number of cores, 6, not 4. That, combined with cropping your overlay image, should get your usage and encoding speed up.
    Quote Quote  
  28. Originally Posted by dedekov View Post
    avs [error]: Script error: there is no function named "mt_merge"
    You need masktools2

    But cropping the overlay down as jagabo suggested is actually quite a bit faster .

    Use x= , y= to position the overlay
    Quote Quote  
  29. Member
    Join Date
    Apr 2014
    Location
    malaysia
    Search Comp PM
    @jagabo after change size watermark then cpu utilization is max .. thank you!
    @poisondeathray i will try masktools2 to check
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!