Log in

View Full Version : How to speed up? bottleneck?


DoomNlNE
5th January 2012, 02:06
i7 8 core
24GB RAM
32GB RamDrive (3GB/s read/write)

x264 --preset fast --crf 0 --demuxer lavf --threads 8 "in.avi" -o "output.mkv"

Source:
I capture games lossless at 60FPS. Resolution is 320x240 (native for emulators)
It seems the capture codec affects the x264 encoding speed.

In my experience:
Uncompressed allows encoding at 700FPS
Camstudio with lowest compression allows encoding at 620FPS.

What would theoretically be the fastest lossless codec to use to speed up x264 encoding?

x264 only uses 20% of my CPU

Any other things I can add to my x264 command to speed up encoding (don't want to use ultrafast preset, etc)?

The problem is with upscaling to 1080p. Upscaling these videos results in a better and far sharper picture when uploaded to youtube.

x264 --preset fast --crf 0 --demuxer lavf --vf resize:1920,1080,,both,, --threads 8 "in.avi" -o "output.mkv"

The HD upscale is VERY slow. 20FPS!!

(This is a particular case for the type of source i'm using. Please don't say upscaling is stupid, you don't know about my source :)).

Any way to speed up?

kypec
5th January 2012, 06:28
Try to use some of the Avisynth's resizers for upscaling your source AVI, perhaps it'll be faster than x264's built-in resizer. Or try to select other resizing method for the resizer if possible... though I'm not sure if x264 supports that.

GEfS
8th January 2012, 04:13
I meet bottleneck too.
http://photo.bitvn.us/images/14026014536961796611.png
Here is my dedicated server and x264 only uses 40-60%.
My setting:
--level 4.1 --pass 2 --bitrate 2200 --stats ".stats" --deblock -3:-3 --bframes 8 --b-adapt 2 --ref 9 --rc-lookahead 50 --aq-mode 2 --aq-strength 1.1 --merange 48 --me umh --direct auto --subme 11 --partitions all --trellis 2 --no-dct-decimate --no-fast-pskip

nm
8th January 2012, 13:08
I meet bottleneck too.

What kind of source video are you encoding? If you use AviSynth for input, post the complete script.

GEfS
8th January 2012, 16:42
Source video is Bluray.
DirectShowSource("D:\toz\Real Steel 2011 1080p AVC DTS-HD MA 7.1-HDChina\F3_T2_Video - .mkv")
Spline36Resize(1280, 544, 0, 132, 0, -132)
LSFmod(ss_x=1.6,ss_y=1.6,Smode=3,Smethod=3,Lmode=3,strength=70,overshoot=3,undershoot=2)
My AviSynth. I'm using ffdshow.

nm
8th January 2012, 17:19
How fast (fps) is the second pass encoding with your x264 settings? Is encoding any faster with default settings or one of the faster x264 presets?

If not, it could be your script or H.264 decoder that slows things down. Which ffdshow version are you using? You could also try FFMS2 instead of DirectShowSource.

Didée
8th January 2012, 17:45
You're bottlenecked by the Avisynth script. LSFmod is slow enough - in particular when supersampling (ss_xy) is used - that Avisynth cannot deliver frames fast enough to keep x264 busy on all cores. You'd need to use multithreaded Avisynth to get more CPU load.

Related, the usage of LSFmod is suboptimal, IMO. First you resize 1920 to 1280, then LSFmod resizes up again to 1280*1.6, then resizes down to 1280 again. That's a bit much of resizing, isn't it ...

This:
DirectShowSource("D:\toz\Real Steel 2011 1080p AVC DTS-HD MA 7.1-HDChina\F3_T2_Video - .mkv")
crop(0,132,-0,-132)
LSFmod(ss_x=1.0,ss_y=1.0,Smode=3,Smethod=3,Lmode=3,strength=70,overshoot=3,undershoot=2)
Spline36Resize(1280, 544)
is almost the same as your script, but a good bit faster. Instead of resizing 3 times (down-up-down), this script resizes only 1x down. (The effective supersampling now is 1.5 instead of 1.6.)

Atak_Snajpera
8th January 2012, 17:46
Source video is Bluray.

My AviSynth. I'm using ffdshow.

use ffms instead of directshowsource. install avisynth mt. after ffvideosource add setmtmode(2,0)