[x264] A Technical advice about choose use CPU version of x264 !

M.S.Referee

New Member
Hi, OBS Team

I'm a "Film CGI and Game CG" CGer and also have more than 15 years video compression experiences.

So, I want to give a advice for you guys for got really improvement of OBS. You should use the '.exe' x264 encoder (It got keep updating version.) of CPU version for OBS and enable to use 'Two Pass' too.

Why do that? For now the "libx264-xxx.dll" version from ffmpeg, in fact no good for any type of compression. The dll version just for got a huge video with huge bitrate. And the '.exe' x264 encoder are great. There are some reasons for it.

1. The encode speed, this is why I advice to enable to use 'Two Pass'. I know lots of people said the 'Two Pass' of CPU encoding impossible for streaming. But I say it's always possible and you just can did the encode time equal or almost equal 1:1 to encode with good version of x264.exe. That means the encoding time range is under enable 'Stream Delay' and like 2 seconds delay setting, and before send streaming the x264.exe has converted first 2 seconds and than keep and no stop encoding and equal or almost equal 1:1 to encode for next serial time, and then you will not got frame disappeared. And I got successful tests already.

2. The compression quality, you want to keep almost closed the original video quality and got as small as possible file size, low bitrate too. It can do that more than dll version, and you absolutely need 'Two Pass'.

3. The convenience and compatibility, for now the dll version "locked" whole program. That's means you just can use "THIS VERSION(like the newest 22.0.2 version of OBS use 'libx264-148.dll (0.148.2762)', and this version also not more good.)" and if you try to update by yourself, you will got program never running and show 'You missing the dll.'. And the '.exe' version of x264 encoder, they are some good team still keep to update it and you can got the exe file easy, and you can updating it by yourself and no more compatibility problem.

This is my example test data, a 3min20s of 2560x1440 resolution Battlefield 4 game capture video with a 64bit stable GCC 8.2 157.2935 version of x264.exe, the encode finished time is 3min30s(Sure this with my x264.exe settings and not use default settings.). And I just use the Twitch limited 6000 kb/s with 'Two Pass' and the 4th Generation Intel i7 4710HQ Laptop to do the encoding (CPU usage average 49%-55%), and the quality almost = 97% of original video. This is the almost 1:1 encoding, the resolution is 2560x1440, and the time is 3min20(video length) : 3min30(encoding).
(If use more powerful computer and CPU, I can keep the quality almost = 99.5% of original video with same bitrate and 1:1 encoding time.)

Other suggestion is add 'neroAacEnc.exe' to do audio encoding. Because it just need 128kb/s for stereo and will made quality 99.8% closed to Wav, and 5.1, 7.1 surround also need low bitrate than others but keep quality.

So, your team should give up the dll version and bring the '.exe' version of x264 in, and to improve and complete also keep optimization the x264.exe settings in OBS two panel (Streaming and Recording), and yes the most important part of setting is 'x264 Options' (in fact it's called 'x264 Command Line'.).
You can reference some free video encoder program how them use x264.exe, like "Simple x264 Launcher".

If OBS into '.exe' version of x264, and improve and complete the x264.exe settings in OBS. I think the OBS streaming quality will go to the next level. And I hope as soon as possible to see the "New Version" of OBS. Thanks! Hope my advice will help.
 
Last edited:

R1CH

Forum Admin
Developer
There is no difference between a DLL encoder and EXE encoder, one is designed to be used by other programs (such as OBS) and one is designed for standalone use. OBS does not invoke external programs for encoding, so it uses the DLL. There is no quality difference between them. Also, as long as the ABI version is compatible, you can drop in a replacement .DLL to update the encoder, but this is rarely necessary as we keep it up to date.
 

DeMoN

Member
The only thing I hate about dlls, you cant define an own/additional commandlines and are dependent on the GUI, which often lacks stuff.
OBS for example allows just keyframes for seconds, instead of frames which would be far more accurate.
NVEnc it has just a fixed CQP, I cant use qmin, qmax combo (at least not in 22, didnt try 23 yet).
especially all that ffmpeg stuff too. Can I use own ffmpeg commands? Some of you say the muxing allow something custom? But "muxing" isnt exactly what I would understand as "custom/additional ffmpeg commandline parameters".
 
Top