Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 Encoder GUIs

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th December 2010, 00:19   #1  |  Link
Cman21
Registered User
 
Join Date: Nov 2010
Posts: 33
MeGui x264 encode only using 20% of CPU

hello, i just got an i7 950 and i am only getting about 17% usage in one instance but i have ran 5 at once to get it up to ~90%. i would like to know what i can do to get my encodes using MeGui and x264 to get my usage at least 50% per instance. i do have CoreAVC installed, with a nvidia 460, but i am pritty sure it is NOT being used for the decoding and since it was mentioned as one of the possible fixes for a bottleneck in decoding i will mention it. below is the media info of the source, then my avs script for MeGui, and then the MeGui x264 profile settings. now i have tried setting threads to 0(auto) 4, 8, and 16 but it doesn't change a thing.

Code:
General
Complete name                    : D:\Encoding Work\test_video.264
Format                           : AVC
Format/Info                      : Advanced Video Codec
File size                        : 3.67 GiB

Video
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format profile                   : High@L4.1
Format settings, CABAC           : Yes
Format settings, ReFrames        : 4 frames
Width                            : 1 920 pixels
Height                           : 1 080 pixels
Display aspect ratio             : 16:9
Frame rate                       : 23.976 fps
Resolution                       : 8 bits
Colorimetry                      : 4:2:0
Scan type                        : Progressive
Color primaries                  : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer characteristics         : BT.709-5, BT.1361
Matrix coefficients              : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177
Code:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\MaskTools.dll")
global MeGUI_darx = 16
global MeGUI_dary = 9
LoadPlugin("C:\Program Files (x86)\megui\tools\dgavcindex\DGAVCDecode.dll")
AVCSource("D:\Encoding Work\Test.dga")

super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)

crop( 2, 2, -2, -2)
LanczosResize(1920,1080) # Lanczos (Sharp)
Code:
program --preset slow --tune animation --crf 19.0 --chroma-qp-offset 2 
--level 4.1 --bframes 3 --ref 4 --slices 4 --aud --nal-hrd vbr --b-pyramid strict 
--keyint 24 --min-keyint 2 --vbv-bufsize 30000 --vbv-maxrate 40000 --weightp 0 
--colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --output "output" "input"
if there is any other info you need just let me know.

also in another thread it was suggested that i use a multithreaded version of AVISynth but i had no idea what he was talking about and how would that help, if at all?

Last edited by Cman21; 13th December 2010 at 00:22.
Cman21 is offline   Reply With Quote
Old 13th December 2010, 00:36   #2  |  Link
nurbs
Registered User
 
Join Date: Dec 2005
Posts: 1,460
How about you don't crosspost and ask your questions in the other thread?
nurbs is offline   Reply With Quote
Old 13th December 2010, 00:42   #3  |  Link
Cman21
Registered User
 
Join Date: Nov 2010
Posts: 33
ya i moved it to the GUI section due to no knowledge of MeGui, and this is a better location anyway as here people would actually know about the Gui im using and could actually offer advice without having to completely relearn all of this stuff another way. though i am still looking into everything he has suggested im just finding it to be more complicated to integrate without completely restarting than i would like it to be.
Cman21 is offline   Reply With Quote
Old 13th December 2010, 01:05   #4  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by nurbs View Post
How about you don't crosspost and ask your questions in the other thread?
I suggested that he'd post here since this is a problem with the gui and not x264.
Groucho2004 is offline   Reply With Quote
Old 13th December 2010, 01:56   #5  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
the problem is not the gui.
the problem could be the decoder and/or avisynth/avs script (since it's not multithreaded).
Sharktooth is offline   Reply With Quote
Old 13th December 2010, 02:01   #6  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Sharktooth View Post
the problem is not the gui.
the problem could be the decoder and/or avisynth/avs script (since it's not multithreaded).
Ah, so megui supplies multithreaded Avisynth and multithreaded filters? In that case I guess the problem would be how he is using the gui?
Groucho2004 is offline   Reply With Quote
Old 13th December 2010, 02:03   #7  |  Link
Cman21
Registered User
 
Join Date: Nov 2010
Posts: 33
ok... im lost here what is wrong? what info do you need to help me determine what the problem might be?
Cman21 is offline   Reply With Quote
Old 13th December 2010, 02:07   #8  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
megui doesnt supply multithreaded avisynth, coz megui doesnt supply avisynth at all. you can install a multithreaded avisynth version BEFORE installing megui AND use the MT modes (see MT avisynth docs) to increase the multithreaded processing efficiency of the avisynth script.
that has to be done manually by editing the script.
you can get some references for AVS MT here: http://avisynth.org/mediawiki/MT and, obviously, on the avisynth forum.
also have a look here: http://forum.doom9.org/showthread.php?t=153808 (expecially THIS post)

Last edited by Sharktooth; 13th December 2010 at 02:12.
Sharktooth is offline   Reply With Quote
Old 13th December 2010, 02:15   #9  |  Link
Cman21
Registered User
 
Join Date: Nov 2010
Posts: 33
ok running this .bat with that aviscript which should be using the x64 and multithreaded avisynth filters gives me a CPU usage of , ya..., ~20% but it is running with a higher fps than before. so the x64 is helping in that area but now im starting to think this might not be a issue with either the programs but maybe my OS or something else limiting me.

Code:
cls
@echo off
echo.
SET ENCODER=C:\Program Files (x86)\MeGui\tools\x264\x264.exe
SET SOURCE=D:\Encoding Work\test.avs
SET TARGET=D:\Encoding Work\test_1080p.264


SET PASS1="%SOURCE%" --preset slow --tune animation --crf 19.0--level 4.1 --output "%TARGET%"

"%ENCODER%" %PASS1%
with this AVIScript

Code:
# Set DAR in encoder to 16 : 9. The following line is for automatic signalling
global MeGUI_darx = 16
global MeGUI_dary = 9
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins64\DirectshowSource.dll")
DirectShowSource("D:\Encoding Work\test.mkv")

LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins64\mvtools2.dll")
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)

crop( 2, 2, -2, -2)
LanczosResize(1920,1080) # Lanczos (Sharp)
Cman21 is offline   Reply With Quote
Old 13th December 2010, 02:17   #10  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
have you installed the MT-masktools?
also, directshowsource will use the default directshow avc decoder you have installed in your system. could you please tell me what it is?
Sharktooth is offline   Reply With Quote
Old 13th December 2010, 02:24   #11  |  Link
Cman21
Registered User
 
Join Date: Nov 2010
Posts: 33
from SEt's Avisynth 2.5.8 MT compiled for *X86_64*, Latest Build 4/16/2010 is where i got everything i used on this last run. i do like the ~30% increase in performance, in fps, but it is still only 20% of my CPU and i HATE waiting 18 hours on this encode while it only uses 20% of my cpu. oh COOL it is using CoreAVC 2.0 now with CUDA on my 460.

EDIT: im starting to think that it is not x264 but something in windows maybe? is there any way to see how many threads a process has to see if i am actually getting all 12 threads that i should be getting?

Last edited by Cman21; 13th December 2010 at 03:11.
Cman21 is offline   Reply With Quote
Old 14th December 2010, 02:28   #12  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
task manager. click on processes then select view menu -> select columns -> select threads -> OK button.
look at the x264 process.
also it could be CUDA decoding is not fast enough to feed the input frames to avisynth, so the encoder gets bottlenecked. try with a multithreaded decoder like ffms-mt or libavcodec-mt (included in the latest ffdshow-mt builds)
Sharktooth is offline   Reply With Quote
Old 16th December 2010, 00:07   #13  |  Link
Cman21
Registered User
 
Join Date: Nov 2010
Posts: 33
ok i looked at that and saw that there where 25 threads involved with x264, which i assume is want i want to see, and i also took a closer look at which cores where being use and i noticed that the first core was around 90% with 3 other cores around 5-10%, with 8 total cores with hyperthreading. could it be that im jut not actually using all my cores for this encode? i do know however when i run a simple encode without the filtering listed above and simply resized the video it ran at full 100%. this is actually starting to annoy me and if i cant figure this out i guess i will just have to deal with it and try to run multiple encodes at the same time to improve cpu utilization.
Cman21 is offline   Reply With Quote
Old 15th July 2014, 12:22   #14  |  Link
killerteengohan
Registered User
 
Join Date: Feb 2013
Posts: 68
I just use multiple MeGui workers to get the rest of the CPU usage since each worker only uses about 30-35% of my cpu, I use 3 of them and do 3 things at the same time.
killerteengohan is offline   Reply With Quote
Old 15th July 2014, 19:43   #15  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
Quote:
Originally Posted by Cman21 View Post
from SEt's Avisynth 2.5.8 MT compiled for *X86_64*, Latest Build 4/16/2010 is where i got everything i used on this last run. i do like the ~30% increase in performance, in fps, but it is still only 20% of my CPU and i HATE waiting 18 hours on this encode while it only uses 20% of my cpu. oh COOL it is using CoreAVC 2.0 now with CUDA on my 460.

EDIT: im starting to think that it is not x264 but something in windows maybe? is there any way to see how many threads a process has to see if i am actually getting all 12 threads that i should be getting?
Did you edit the script to add SetMTMode()'s?

Avisynth is by default single threaded, you need to tell it to use more because x264 is waiting on Avisynth most of the time. One core is busy with Avisynth while the rest are used by x264 and are mostly idle waiting for Avisynth.

I also strongly suggest you use Avisynth 2.6 MT instead of 2.5.8.
Asmodian is offline   Reply With Quote
Old 15th July 2014, 22:09   #16  |  Link
detmek
Registered User
 
Join Date: Aug 2009
Posts: 463
Look at post date.
detmek is offline   Reply With Quote
Old 16th July 2014, 00:40   #17  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
Ack, thanks - no need to answer a four year old thread.
I guess killerteengohan was posting for Google's benefit?
Asmodian is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.