Log in

View Full Version : x264 video encoding not using 100%


invy
19th October 2011, 02:01
source: 1080i MPEG2
encoding to: 704x384, 1200 kbps, x264, 2pass, default 'tuning' profile and medium preset.

how do I make it encode faster? I want it to use more cpu cycles. typically it is only using about 40% of my quad cores and only about 32 FPS encoding.

it's very annoying and boring encoding this slow.

thanks!

AMED
20th October 2011, 00:00
post you AVS script please.

invy
20th October 2011, 00:42
it's basically nothing, since I know absolute ZERO about scripting. I just use the AVS script creator thing a ma jig for general settings.

LoadPlugin("C:\Program Files\megui\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("D:\rec\test.d2v")
Load_Stdcall_Plugin("C:\Program Files\megui\tools\yadif\yadif.dll")
Yadif(order=1)
#crop
Lanczos4Resize(704,384) # Lanczos4 (Sharp)
#denoise

see? basically nothing. any suggestions what settings to use to speed up encoding time for 1080 stuff? I don't care about tip top quality much since I just watch and delete. I encode just to save hdd space.

If I can get the FPS from 30 ish to 60, then it would be great.

and comp is a phenom ii x4, 3.2 ghz, 4 gb ram, windows 7

oh and when I encode basic SD 480 stuff, it uses almost 100%.

Atak_Snajpera
20th October 2011, 12:58
Install this http://www.mediafire.com/?kjdzqyz4dyj
and then add these lines to your script


SetMTMode(5,0)
LoadPlugin("C:\Program Files\megui\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("D:\rec\test.d2v")
Load_Stdcall_Plugin("C:\Program Files\megui\tools\yadif\yadif.dll")
SetMTMode(2)
Yadif(order=1)
#crop
Lanczos4Resize(704,384) # Lanczos4 (Sharp)
#denoise

invy
20th October 2011, 23:36
Hi, and thanks for the reply. I really appreciate it. However I have a few thoughts.

1. Is there any reason why you chose (5,0), instead of the supposedly faster (1,0)? In my time of using MeGUI, all my encodes have been MPEG2Source().

2. I was reading up on the MT wiki page and noticed the usability of the MTmodes depends on filter that is being used? Is that correct?

3. Lastly, I'm not particularly fond of yadif. Perhaps there is another (faster) deinterlace filter that you can recommend, so I can take more advantage of with SetMTMode?

BTW, I lied about having absolute zero knowledge of this, as you may have noticed now. I guess it's more like 15%. :P


EDIT: I almost forgot about most important part. My results from the script:

usually for 2-pass I would get ~30-35 fps for 1st, and ~30-35 fps for 2nd.

but with script it was 60 fps (yay), but only 24 fps for 2nd pass.

is this expected behavior for 2nd pass?

Atak_Snajpera
21st October 2011, 15:56
1. Is there any reason why you chose (5,0), instead of the supposedly faster (1,0)? In my time of using MeGUI, all my encodes have been MPEG2Source().
5 is safer than 2 or 1. But you can try 2 ofcourse.

3. Lastly, I'm not particularly fond of yadif. Perhaps there is another (faster) deinterlace filter that you can recommend, so I can take more advantage of with SetMTMode?
in terms of quality and speed yadif is the best

second pass is always slower because x264 does more calculations.

invy
21st October 2011, 16:39
Okay, I see.

I have a problem with yadif though. Whenever i use yadif deinterlacer for standard definition content that is captured from my Hauppauge analog capture card, any horizontal lines look horrible. Such as in a basketball game when camera is moving side to side, the 3pt line, sidelines, etc, it is very noticeable in such scenes.

So for that, i usually use FieldDeinterlace instead of yadif. but I noticed that x264 crashes whenever I try MTmode with it.

Is there a fast alternate deinterlacer to it that you can recommend?

By the way, is Decomb.dll the same thing as FieldDeinterlace?

hello_hello
25th October 2011, 15:26
For SD content I tend to use yadif, and if I'm not happy with the result my next choice is LeakKernelDeint. I don't use the MT version of AVIsynth though, so whether it effects the de-interlacing speed or not I don't know.
Personally I've not had the motivation to try the MT version because most of the time my Q9450 sits pretty much on 100% while encoding (x264) so as I figured CPU usage can't increase beyond 100% anyway... Is that a sound theory?

I can't help myself, I usually have to ask..... do you have a particular need to encode to a particular file size? I gave up 2 pass encoding as soon as I started using the x264 encoder in preference to Xvid. Single pass CRF encoding would save you some time if speed is an issue.

invy
25th October 2011, 19:28
For SD content I tend to use yadif, and if I'm not happy with the result my next choice is LeakKernelDeint. I don't use the MT version of AVIsynth though, so whether it effects the de-interlacing speed or not I don't know.
Personally I've not had the motivation to try the MT version because most of the time my Q9450 sits pretty much on 100% while encoding (x264) so as I figured CPU usage can't increase beyond 100% anyway... Is that a sound theory?

I can't help myself, I usually have to ask..... do you have a particular need to encode to a particular file size? I gave up 2 pass encoding as soon as I started using the x264 encoder in preference to Xvid. Single pass CRF encoding would save you some time if speed is an issue.

Have you ever tried to encode HD content? It never uses anywhere near 100% (without MT Avisynth of course), at least for me. However SD stuff is different, always 90%+ with it.

Other than it's just what i'm used to, no, I have no real reason to target a specific file size.

Atak_Snajpera
25th October 2011, 19:43
resize function is your bottleneck

dlnalover94
28th October 2011, 23:03
If it takes more time to decode and resize than to encode, then you will not hit 100% no matter what.

hello_hello
1st November 2011, 22:17
Have you ever tried to encode HD content? It never uses anywhere near 100% (without MT Avisynth of course), at least for me. However SD stuff is different, always 90%+ with it.

Other than it's just what i'm used to, no, I have no real reason to target a specific file size.

I usually encode at 720p, but yeah I'm fairly sure the CPU would be running pretty hard most of the time. Next time I encode a Bluray I'll have to check though, just to make sure I'm not lying to you.

I am, as I type, currently converting a 720p video to 480p using x264. CPU usage is sitting fairly steadily on 100%.

After so many years encoding with Xvid it almost took a bit of a mindset adjustment to forgo 2 pass encoding for CRF encoding when using x264, but I'm glad I did. Now if I encode while watching Xvid perform two passes it makes me want to bang my head on the desk.