View Full Version : Need help tweaking encoding settings
Sagekilla
7th August 2008, 19:41
I need some help tweaking my settings so I can use up more of my CPU. I'm currently doing filtering on one computer and transferring the frames over my network to another computer for encoding. Only problem is filtering is such a slow operation that my x264 is bottlenecked still, so I have room to "improve" my settings for more compression, if even possible.
Here's my current settings:
x264 --crf 19 --keyint 1000 --level 4.1 --ref 9 --mixed-refs --bframes 6 --b-pyramid --weifghtb --b-rdo --b-adapt 2 --bime --subme 7 --me umh --merange 32 --8x8dct --direct-8x8 -1 --trellis 2 --psy-rd 0.8 --aq-strength 0.8 --progress --threads auto --output "video.264" --pass 1 --stats "stats.log" "tcpsource.avs"
I use keyint 1000 because I don't mind the extra seek time (it's invisible to me) for some more compression, and my particular series I'm encoding benefits from it because of the very long scenes.
Filtering is done on an Opteron 170, while encoding is done on a C2D @ 2.17 GHz. I'd probably stand to benefit from decoding on my C2D and encoding on my Opteron, but I have to test this still.
Any help would be appreciated!
Dark Shikari
7th August 2008, 19:42
x264 --crf 19 --keyint 1000 --level 4.1 --ref 9 --mixed-refs --bframes 6 --b-pyramid --weifghtb --b-rdo --b-adapt 2 --bime --subme 7 --me umh --merange 32 --8x8dct --direct-8x8 -1 --trellis 2 --psy-rd 0.8 --aq-strength 0.8 --progress --threads auto --output "video.264" --pass 1 --stats "stats.log" "tcpsource.avs"
For one, its --weightb not --weifghtb ;)
Other things you can do to slow yourself down:
1. More refs.
2. --me tesa.
3. --no-fast-pskip.
Sagekilla
7th August 2008, 19:49
For one, its --weightb not --weifghtb ;)
Other things you can do to slow yourself down:
1. More refs.
2. --me tesa.
3. --no-fast-pskip.
Sorry, I was typing what I had for settings from my laptop ;) It's correctly written down as --weightb, just a typo.
Only problem is I don't want to increase refs because I'm at the ref limit (9) for level 4.1 and DXVA compatibility. I was considering increasing --bframes too, since I'm running your new b-frames patch, but quality increase would be too small.. So that leaves me with enabling --me esa and --no-fast-pskip hm? I'd try tesa but I think my laptop would become the bottleneck with x264.
Sharktooth
7th August 2008, 19:54
since you're using --b-adapt 2 you can also rise the number of b-frames to slow it down... however as you said, maybe it's not worth it.
--me tesa and --no-fast-pskip are the only things left then.
Dark Shikari
7th August 2008, 19:55
since you're using --b-adapt 2 you can also rise the number of b-frames to slow it down...ESA/TESA with lower merange (i.e. lower than 32) is probably more useful relative to speed cost than more bframes.
Sagekilla
7th August 2008, 20:08
Tweaked it again, dropped merange down to 24 and I'm using ESA and it's running at 100% usage on both computers :) Had to drop my filtering settings a bit though, otherwise I would overshoot it with x264.
Adub
7th August 2008, 21:38
Are you running AVFS by chance?
Sagekilla
7th August 2008, 22:39
As far as I know, no. What is AVFS?
Adub
7th August 2008, 22:49
So how are you transferring the frames over the network? TCPSource?
Sagekilla
7th August 2008, 22:53
Yep, this has been the only way to get anywhere above 1 fps for encoding. I usually got 0.5 - 0.6 fps on either computer with my filtering + encoding.
Edit: For that matter, I have no method of accessing files between the two computers because I have issues with file sharing between my laptop (Vista) and desktop (XP). Part of the reason is my desktop is somehow locked up from being accessed by anyone in my network. They can see it, but not access it.
Adub
7th August 2008, 23:10
Ah, I see.
I use AVFS to send the frames over my network, so I can filter on one computer running XP, and then encode directly with x264 on my 64 bit gentoo build. No need for a wine avisynth install or anything.
The only problem is that it sucks bandwidth like crazy. It's all uncompressed, so it's huge. Hopefully there will be at least some compression in future versions. Right now I just need to get a gigabit card for my laptop.
Sagekilla
7th August 2008, 23:35
How I wish I could use AVFS, it sounds like it would be much easier than using TCPServer and TCPSource. Unfortunately, as my XP desktop computer is effectively blocked from any file sharing for whatever reason, I have to use TCPsource. I do have a 100 megabit connection running between the two, and the movies I encode are HD so it's highly unlikely I'll be bottlenecked by the network. I don't think I'll ever see x264 encoding at 9 fps for 720p.
Adub
7th August 2008, 23:45
Oh, quite the contrary. Since everything is sent uncompressed over the network, you would be hardpressed to get above 13fps on and SD source on 100mb. That's why I am looking for a 1000mb card for my laptop. Uncompressed frames are HUGE!
Linky: http://forum.doom9.org/showthread.php?p=1148124#post1148124
But, if as you say, you plan on encoding well under the 9fps mark, then I guess you should be fine with a megabit network. Provided of course the bottleneck was your script.
Sagekilla
8th August 2008, 00:15
But I don't work with SD, I work with HD. I don't use fast compression settings at all so the network is not the bottleneck, the CPUs are ;) I was talking about my setup there.
Also, unless I get a pair of quad cores I doubt I'll ever see more than even 4 fps (if I'm lucky) working with Blu-ray movies. Decompressing them is bad enough!
Avenger007
8th August 2008, 01:32
Would "--partitions all" break High@L4.1?
Sagekilla
8th August 2008, 01:37
No, but it's fairly useless to enable p4x4..
Adub
8th August 2008, 01:57
But I don't work with SD, I work with HD.
I understand that, I was just expressing my past experiences with SD to give some perspective. HD material would be much slower, but that doesn't sound to be your issue.
Sharktooth
8th August 2008, 03:11
http://forum.doom9.org/showthread.php?p=996577#post996577
Dark Shikari
8th August 2008, 03:13
http://forum.doom9.org/showthread.php?p=996577#post996577Of course, no known decoder actually cares about the restriction on the max number of motion vectors per macroblock (this has been tested, IIRC).
Sharktooth
8th August 2008, 03:26
however p4x4 is not helping much (if at all) at SD... and it wont help for sure with HD.
it may be useful at lower resolutions though.
Avenger007
8th August 2008, 04:30
i4x4 is used as one of the default partitions, so what's the difference with p4x4 in terms of use/usefulness?
Dark Shikari
8th August 2008, 04:38
i4x4 is used as one of the default partitions, so what's the difference with p4x4 in terms of use/usefulness?Totally different. i4x4 is extremely useful.
Avenger007
8th August 2008, 04:40
How so?
I've never seen any guides explaining the difference between i4x4 and p4x4.
Dark Shikari
8th August 2008, 04:41
How so?
I've never seen any guides explaining the difference between i4x4 and p4x4.i4x4 is an intra block type that allows the different prediction modes to be chosen for each 4x4 block.
p4x4 actually means "subp8x8," which describes a category of subpartitions which have motion vectors for each 4x8, 8x4, or 4x4 partition. This is generally not very useful, since motion is rarely so small-scale and the extra motion vectors cost a lot of bits.
Sagekilla
8th August 2008, 04:44
Just wondering, I always wondered how it looked to the encoder. To that extent, I thought it looked something like: "I can encode 4 4x4 partitions, but it'd cost 1200 bits total for all the vectors, or I can encode 1 8x8 partition and it'd 400 bits plus 200 residual"
Is that correct?
Dark Shikari
8th August 2008, 04:49
Just wondering, I always wondered how it looked to the encoder. To that extent, I thought it looked something like: "I can encode 4 4x4 partitions, but it'd cost 1200 bits total for all the vectors, or I can encode 1 8x8 partition and it'd 400 bits plus 200 residual"
Is that correct?Yes. The non-RD mode decision counts a bit cost approximation for motion vectors and other syntax elements, multiplied by a lambda representing the "value" of each bit. The residual is represented as SATD score.
Avenger007
8th August 2008, 04:55
i4x4 is an intra block type that allows the different prediction modes to be chosen for each 4x4 block.
p4x4 actually means "subp8x8," which describes a category of subpartitions which have motion vectors for each 4x8, 8x4, or 4x4 partition. This is generally not very useful, since motion is rarely so small-scale and the extra motion vectors cost a lot of bits.
Thanks for the info. :)
Maybe that should be in the x264 Settings MeWiki guide. The comment it gives isp4x4 is generally not very useful and has an extremely high ratio of speed cost to resulting quality gain.
I always use "--partitions all" when encoding, but now I think I'll stick with defaults since it might save some bits. :)
Sagekilla
8th August 2008, 05:04
Technically it wouldn't really "save" bits by not using --partitions all, according to what Dark Shikari just said, since the encoder would never choose a partition that wastes bits. But, it is useful to disable since it would speed the encode up a bit with little to no impact on quality/bitrate :) At least, that's what I've gotten from his description.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.