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 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th December 2009, 11:02   #1  |  Link
Mixer73
Registered User
 
Join Date: Nov 2007
Posts: 240
Please critique my x264 settings!

OK seeing as there's no 'right' and 'wrong' I'm looking for some areas where I can improve the efficiency of my encoding, while maintaining device compatibility, and I'm looking for some suggestions from people who know better than I.

Some background:

I have a long background with compression technologies, having been involved with companies like Macrovision, Fast, Quadrant, DPS, Darim, Optibase, Sonic Foundry, Canopus, Pioneer. I would have considered myself an expert in MPEG2 and early MPEG4 compression, however I don't have the time professionally to keep up those skills for present methods.

Currently I work with products from Viewcast but the needs for realtime compression are very different to what I am trying to achieve here.

My aim is to create nearly lossless results from fairly poor broadcast MPEG2, for playback either on DXVA or PS3/Xbox360. Primarily I playback on 7MCE, but I often take files to a friend's house who has a PS3. I also have a PSP so I'd like to understand what settings I might have to change to use that (apart from resolution), or whether I can do a one-size-fits-all profile.

Contrary to the above I do store a lot of TV so I want to get the files as small as possible while maintaining the quality. Hence quality-based 3-pass encoding. SD encodes I do at 720 width, HD encodes at 960 width. I've used deblocking 1:1 because the source material seems overly sharp, and I feel 1:1 delivers a very watchable picture.

My GUI is Xvid4PSP which isn't as well known as the others, and also doesn't support the standard preset system.

What I am hoping for is whether changes to things like ref frames or other more complex settings might give me more efficiency without terrible time penalties, and most importantly maintaining compatibility. I'm encoding on a Q6600, I can't wait until I can afford an i7.

So the challenge, give me some feedback. I'm very happy with the results I'm getting. Typically my files are half the size of a "scene" rip with equivalent quality.

Please tell me:
1. Anything you suggest that might realise smaller files
2. Anything I'm using that might be overkill, ie not worth the tradeoff time vs filesize
3. Anything else of relevance?

Code:
video codec:
x264

video cli:
--pass 1 --crf 24.0 --level 4.1 --deblock 1:1 --direct auto --b-adapt 2 --trellis 2 --qcomp 0.5 --vbv-bufsize 24000 --vbv-maxrate 24000 --partitions all --subme 9 --me esa --rc-lookahead 60
--pass 3 --crf 24.0 --level 4.1 --deblock 1:1 --direct auto --b-adapt 2 --trellis 2 --qcomp 0.5 --vbv-bufsize 24000 --vbv-maxrate 24000 --partitions all --subme 9 --me esa --rc-lookahead 60
--pass 2 --crf 24.0 --level 4.1 --deblock 1:1 --direct auto --b-adapt 2 --trellis 2 --qcomp 0.5 --vbv-bufsize 24000 --vbv-maxrate 24000 --partitions all --subme 9 --me esa --rc-lookahead 60
Mixer73 is offline   Reply With Quote
Old 14th December 2009, 11:09   #2  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Mixer73 View Post
video cli:
--pass 2 --crf 24.0 --level 4.1 --deblock 1:1 --direct auto --b-adapt 2 --trellis 2 --qcomp 0.5 --vbv-bufsize 24000 --vbv-maxrate 24000 --partitions all --subme 9 --me esa --rc-lookahead 60
1. Your commandlines won't even work. You can't use multi-pass with CRF.
2. Use the presets and dump everything in bold. The presets are your friend.
3. I have no idea why you are lowering qcomp--and I doubt you do either. For deblocking, why not run a preprocessing filter, like fft3dfilter or dfttest? x264's deblocking is not meant to fix a crappy source.
4. You said "near lossless"; crf 24 is hardly that, though perhaps with your crappy source you could get away with it.
5. The VBV settings don't at all match the level you're using. Why did you pick 24 megabit?
Quote:
My GUI is Xvid4PSP which isn't as well known as the others, and also doesn't support the standard preset system.
How can it "not support" the preset system? Presets are just commandline options. Anything that offers an interface to let you add arbitrary options will clearly let you use presets.

Last edited by Dark Shikari; 14th December 2009 at 11:12.
Dark Shikari is offline   Reply With Quote
Old 14th December 2009, 11:23   #3  |  Link
Mixer73
Registered User
 
Join Date: Nov 2007
Posts: 240
Actually I should clarify, these are not actually x264 command lines, its the way my GUI stores the settings. Xvid4PSP uses its own presets and doesn't have the normal presets you see with Staxrip or MeGUI.

I might go and pull out the command lines once I've started an encode, that might be clearer.
Mixer73 is offline   Reply With Quote
Old 14th December 2009, 11:33   #4  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Mixer73 View Post
Actually I should clarify, these are not actually x264 command lines, its the way my GUI stores the settings. Xvid4PSP uses its own presets and doesn't have the normal presets you see with Staxrip or MeGUI.
"Normal presets"? The presets are available natively in x264 as --preset. Staxrip and MeGUI's "presets" are unrelated to these. See x264 --help for details.
Dark Shikari is offline   Reply With Quote
Old 14th December 2009, 11:35   #5  |  Link
Mixer73
Registered User
 
Join Date: Nov 2007
Posts: 240
Well actually looks like those ARE the command lines.

That whole thing is made by Xvid4PSP, I have changed certain things but nothing I didn't understand, so I can't say why some things are set

If I use those presets are they just single pass presets, I would still have to manually manage the multiple passes?

I'm not so sure on this stuff, this is why I need a GUI.
Mixer73 is offline   Reply With Quote
Old 14th December 2009, 11:41   #6  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Mixer73 View Post
If I use those presets are they just single pass presets, I would still have to manually manage the multiple passes?
CRF is single-pass only, so I'm not sure what your worry is here. For that matter, the presets have precisely zero to do with whether you use single or multi-pass; they solely affect the speed vs quality tradeoff. Read the help.
Quote:
Originally Posted by Mixer73 View Post
I'm not so sure on this stuff, this is why I need a GUI.
You seem to be very interested in choosing an optimal commandline, yet you're trying to rely on GUIs that don't generate such. Why not pick a different one?
Dark Shikari is offline   Reply With Quote
Old 14th December 2009, 11:48   #7  |  Link
Mixer73
Registered User
 
Join Date: Nov 2007
Posts: 240
Quote:
Originally Posted by Dark Shikari View Post
You seem to be very interested in choosing an optimal commandline, yet you're trying to rely on GUIs that don't generate such. Why not pick a different one?
Well I can only say the results I have been getting out of Xvid4PSP have been excellent, and the developers have been good with bug fixes and stuff.

I couldn't get the same result out of StaxRip, and I couldn't get a result at all out of MeGUI.

I'm sure Xvid4PSP is out of date re the presets but I am getting good results out of it now.

But perhaps its time to revisit StaxRip.
Mixer73 is offline   Reply With Quote
Old 14th December 2009, 11:51   #8  |  Link
Mixer73
Registered User
 
Join Date: Nov 2007
Posts: 240
It does seem that with each pass, the bitrate is being refined for the next pass in the cmd line.
Mixer73 is offline   Reply With Quote
Old 14th December 2009, 12:02   #9  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
What's the point of asking for a critique of your settings if you're just going to throw them in the bin and use some other unrelated preset from Xvid4PSP anyways? Seriously, I don't understand the point of this thread. The settings you posted won't even work. Therefore, if they are working, you're not using those settings.

Also, I'm just going to make a little guess here, but I'm pretty sure I know more about x264 than the Xvid4PSP developers. Just a hunch.
Dark Shikari is offline   Reply With Quote
Old 14th December 2009, 12:08   #10  |  Link
Mixer73
Registered User
 
Join Date: Nov 2007
Posts: 240
Quote:
Originally Posted by Dark Shikari View Post
What's the point of asking for a critique of your settings if you're just going to throw them in the bin and use some other unrelated preset from Xvid4PSP anyways? Seriously, I don't understand the point of this thread. The settings you posted won't even work. Therefore, if they are working, you're not using those settings.
Well I'm hoping that any settings I can learn can translate to whatever tool I use, if Staxrip provides a more up to date command line that makes more sense then perhaps I can use that and integrate the advice you have given me.

I have no doubt you know a whole lot more than anybody, but I'm not sufficiently expert to use the command lines on their own at the moment, I need a GUI to glue it all together for me.

So I'm hoping that with Staxrip I can sort all the rest, and get a working command line that DOES make sense so I can improve what I am doing.

I'm only using Xvid4PSP because its very easy to use, and whatever the go is with the strange command line, it is giving me a result.

However it sounds as if I may be able to get the same or better result, quicker using x264 more closely to how its meant to be used.

This is the whole output of a job in progress with Xvid4PSP if it makes anything clearer:

Code:
TASK
------------------------------
Format: MP4 PS3 or XBOX360
Duration: 01:47:13:560 (160839)
VideoDecoder: MPEG2Source
Resolution: 1440x1080 > 720x400
VCodecPreset: Custom
VEncodingMode: ThreePassQuality
VideoCodec: MPEG2 > x264
VideoBitrate: 11980 > Q24.0
Framerate: 25.000
SourceType: PROGRESSIVE
FieldOrder: UNKNOWN
AudioDecoder: bassAudioSource
AEncodingPreset: AAC-HE ABR 64k
AudioCodec: AC3 > AAC
AudioBitrate: 384 > 64
Samplerate: 48000
Channels: 2

SCRIPT
------------------------------
import("C:\Program Files (x86)\Winnydows\XviD4PSP5\dlls\AviSynth\functions\AudioFunctions.avs")
import("C:\Program Files (x86)\Winnydows\XviD4PSP5\dlls\AviSynth\functions\VideoFunctions.avs")
loadplugin("C:\Program Files (x86)\Winnydows\XviD4PSP5\apps\DGMPGDec\DGDecode.dll")
loadplugin("C:\Program Files (x86)\Winnydows\XviD4PSP5\dlls\AviSynth\plugins\bass\bassAudio.dll")

video = MPEG2Source("C:\Encode\MOVIE- Mr - Mrs Smith - Nine Digital HD (2009-12-08 20-20).index\MOVIE- Mr - Mrs Smith - Nine Digital HD (2009-12-08 20-20).d2v",cpu=0,info=3)
audio = bassAudioSource("C:\Encode\MOVIE- Mr - Mrs Smith - Nine Digital HD (2009-12-08 20-20).index\MOVIE- Mr - Mrs Smith - Nine Digital HD (2009-12-08 20-20) T80 2_0ch 384Kbps DELAY 0ms.ac3")
AudioDub(video, audio)

AutoYV12()
Spline16Resize(720, 400)



VIDEO ENCODING
------------------------------
Encoding video to: C:\Temp\0098.264
x264 Q24.0 720x400 25.000fps (160839 frames)
...first pass...
 
x264.exe: --pass 1 --crf 24.0 --level 4.1 --deblock 1:1 --direct auto --b-adapt 2 --trellis 2 --qcomp 0.5 --vbv-bufsize 24000 --vbv-maxrate 24000 --partitions all --subme 9 --me esa --rc-lookahead 60 --sar 1:1 --stats "C:\Temp\0098.log" --output "C:\Temp\0098.264" "C:\Temp\0098.avs"
 
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: cabac=1 ref=1 deblock=1:1:1 analyse=0x1:0 me=dia subme=2 psy=1 psy_rd=0.0:0.0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 chroma_qp_offset=0 threads=6 nr=0 decimate=1 mbaff=0 constrained_intra=0 bframes=3 b_pyramid=0 b_adapt=2 b_bias=0 direct=3 wpredb=1 wpredp=2 keyint=250 keyint_min=25 scenecut=40 rc_lookahead=60 rc=crf mbtree=1 crf=24.0000 qcomp=0.50 qpmin=10 qpmax=51 qpstep=4 vbv_maxrate=24000 vbv_bufsize=24000 ip_ratio=1.40 aq=1:1.00
x264 [info]: profile Main, level 4.1
Best bitrate for Q24.0: 456kbps
...second pass...
 
x264.exe: --pass 3 --bitrate 456 --level 4.1 --deblock 1:1 --direct auto --b-adapt 2 --trellis 2 --qcomp 0.5 --vbv-bufsize 24000 --vbv-maxrate 24000 --partitions all --subme 9 --me esa --rc-lookahead 60 --stats "C:\Temp\0098.log" --sar 1:1 --output NUL "C:\Temp\0098.avs"
 
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: cabac=1 ref=3 deblock=1:1:1 analyse=0x3:0x133 me=esa subme=9 psy=1 psy_rd=1.0:0.0 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 chroma_qp_offset=-2 threads=6 nr=0 decimate=1 mbaff=0 constrained_intra=0 bframes=3 b_pyramid=0 b_adapt=2 b_bias=0 direct=3 wpredb=1 wpredp=2 keyint=250 keyint_min=25 scenecut=40 rc_lookahead=0 rc=2pass mbtree=1 bitrate=456 ratetol=1.0 qcomp=0.50 qpmin=10 qpmax=51 qpstep=4 cplxblur=20.0 qblur=0.5 vbv_maxrate=24000 vbv_bufsize=24000 ip_ratio=1.40 aq=1:1.00
x264 [info]: profile High, level 4.1
...last pass...
 
x264.exe: --pass 2 --bitrate 456 --level 4.1 --deblock 1:1 --direct auto --b-adapt 2 --trellis 2 --qcomp 0.5 --vbv-bufsize 24000 --vbv-maxrate 24000 --partitions all --subme 9 --me esa --rc-lookahead 60 --stats "C:\Temp\0098.log" --sar 1:1 --output "C:\Temp\0098.264" "C:\Temp\0098.avs"
 
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: cabac=1 ref=3 deblock=1:1:1 analyse=0x3:0x133 me=esa subme=9 psy=1 psy_rd=1.0:0.0 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 chroma_qp_offset=-2 threads=6 nr=0 decimate=1 mbaff=0 constrained_intra=0 bframes=3 b_pyramid=0 b_adapt=2 b_bias=0 direct=3 wpredb=1 wpredp=2 keyint=250 keyint_min=25 scenecut=40 rc_lookahead=0 rc=2pass mbtree=1 bitrate=456 ratetol=1.0 qcomp=0.50 qpmin=10 qpmax=51 qpstep=4 cplxblur=20.0 qblur=0.5 vbv_maxrate=24000 vbv_bufsize=24000 ip_ratio=1.40 aq=1:1.00
x264 [info]: profile High, level 4.1
Mixer73 is offline   Reply With Quote
Old 14th December 2009, 12:08   #11  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Whats with Doom10.org ?
__________________
Quote:
Originally Posted by Dark Shikari View Post
If they can beat x264 in visual quality on ordinary test clips without postprocessing, I'll eat my hat.
juGGaKNot is offline   Reply With Quote
Old 14th December 2009, 12:11   #12  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Mixer73 View Post
However it sounds as if I may be able to get the same or better result, quicker using x264 more closely to how its meant to be used.
Erm, then why not modify your settings in Xvid4PSP to do so accordingly? I'm not sure what's so hard about this.

You've gone out of your way to change the settings from the (rather reasonable) defaults of Xvid4PSP to include a pointless exercise in 3-pass encoding. What's stopping you from changing them back?

I'm completely confused at this point. I gave you suggestions, many of which are equally applicable regardless of what GUI you use. Yet you haven't implemented a single one of them--nor given me a good reason why you haven't--despite the fact that you started this thread for the express purpose of asking for suggestions.

I give up.
Dark Shikari is offline   Reply With Quote
Old 14th December 2009, 12:14   #13  |  Link
Mixer73
Registered User
 
Join Date: Nov 2007
Posts: 240
Quote:
Originally Posted by Dark Shikari View Post
You've gone out of your way to change the settings from the (rather reasonable) defaults of Xvid4PSP to include a pointless exercise in 3-pass encoding. What's stopping you from changing them back?
Nothing particularly, I'm just concerned by the fact that the settings in Xvid4PSP seem to have drifted somewhat from x264s. I'm just wondering if I try StaxRip it might be simpler.

3-pass encoding is in the drop down boxes so I used it, and have been for some time.

I'm just hesitant to go in and change the command line settings because I don't understand very much of it at all.

When you said above "dump the settings in bold" did you mean ad the bolded settings to presets and then try that?

I do really appreciate your help, and I'm sorry if I seem dumb!
Mixer73 is offline   Reply With Quote
Old 14th December 2009, 12:16   #14  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Mixer73 View Post
Nothing particularly, I'm just concerned by the fact that the settings in Xvid4PSP seem to have drifted somewhat from x264s. I'm just wondering if I try StaxRip it might be simpler.
If you're looking for simple GUIs, there are vastly simpler than either of those, like that new Micro x264 GUI. Check the GUI board...
Quote:
Originally Posted by Mixer73 View Post
3-pass encoding is in the drop down boxes so I used it, and have been for some time.
Using more than one pass with CRF is stupid. Got that? Now don't do it.
Quote:
Originally Posted by Mixer73 View Post
I'm just hesitant to go in and change the command line settings because I don't understand very much of it at all.
If you don't understand an option, don't use it. Your commandline is full of options that you don't understand, so you shouldn't be using them.
Quote:
Originally Posted by Mixer73 View Post
When you said above "dump the settings in bold" did you mean ad the bolded settings to presets and then try that?
Dump. Remove. Eliminate. Drop. Excise. Discard. Eject. Eradicate...
Dark Shikari is offline   Reply With Quote
Old 14th December 2009, 12:18   #15  |  Link
Mixer73
Registered User
 
Join Date: Nov 2007
Posts: 240
Quote:
Originally Posted by Dark Shikari View Post
Dump. Remove. Eliminate. Drop. Excise. Discard. Eject. Eradicate.
Right OK, I made the 'mistake' of x-posting this to Doom10 as well and I got other "advice" over there which confused me more!

Funny that I posted there so you would see it and was expecting others to help me here :P

So 2-pass and remove the stuff in bold, check.
Mixer73 is offline   Reply With Quote
Old 14th December 2009, 12:19   #16  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Mixer73 View Post
So 2-pass and remove the stuff in bold, check.
No, as I said above, more than one pass with CRF is pointless.

Anyways, I'm tired of repeating myself. I've said "don't use more than one pass with CRF" in four separate ways in this thread already.
Dark Shikari is offline   Reply With Quote
Old 14th December 2009, 12:21   #17  |  Link
Mixer73
Registered User
 
Join Date: Nov 2007
Posts: 240
Thanks, I'll go do some testing.

What I didn't expect to find out was that my cmd lines are largely a balls up!
Mixer73 is offline   Reply With Quote
Old 14th December 2009, 12:34   #18  |  Link
Mixer73
Registered User
 
Join Date: Nov 2007
Posts: 240
Got the message regarding multiple passes.

So how does this look:

--preset veryslow --tune animation --crf 24.0 --level 4.1 --deblock 1:1

I found out that Xvid4PSP can save custom command lines so this could be a lot easier than I thought.

Last edited by Mixer73; 14th December 2009 at 12:50.
Mixer73 is offline   Reply With Quote
Old 14th December 2009, 13:39   #19  |  Link
nurbs
Registered User
 
Join Date: Dec 2005
Posts: 1,460
--tune animation already contains --deblock 1:1
nurbs is offline   Reply With Quote
Old 14th December 2009, 13:50   #20  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Mixer73, you can type "x264.exe --fullhelp" for a complete list of all presets/tunes and the parameters they actually set.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR 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 00:39.


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