Post Reply 
MPEG-4 AVC/AAC... again!
x264 is glorious... but so many options!
Author Message
bboy_sonik
Byeeeeeeeeee

Posts: 132.3019
Threads: 8
Joined: 9th Aug 2007
Reputation: 0.76198
E-Pigs: 2.8344
Offline
Post: #1
MPEG-4 AVC/AAC... again!
MPEG-4 AVC/AAC... again.

Well I didn't want to revive an old thread...

I started using MediaCoder, the new v0.7.0 RC2 came out recently, which encodes with x264 encoder.

Much better than TMPGEnc, I should of listended to Zinga all along XD

Here's a copy of my command line i use as a "base" - I was wondering if anyone has any recommendations. Incase you're wondering, yes it is pretty damn slow but I don't mind as it's for permanent archiving of my DVD movies! But is it efficient though...?

Code:
# ".\codecs\x264.exe" "$(SourceFile)" --no-psnr --no-ssim --keyint 250 --min-keyint 25 --level 30 --me umh --merange 32  --no-fast-pskip --non-deterministic --aq-mode 1 --aq-strength 1.0 --b-adapt 2 --ref 16 --subme 9 --psy-rd 1:0 --bframes 16 --direct auto --mixed-refs --trellis 1 --b-pyramid --weightb --crf 22 --sar 4:3 --threads auto --partitions all -o "$(DestFile)"


I was doing the whole "fullscreen video alt-tab" back and forth between the original 1080p video, and the resulting output from the above, and while the filesize and quality was *ok*, I noticed the colour saturation/levels was noticebly.... bleaker, for lack of a better word. Washed out, even. Any way to improve on that without increasing filesize too much?

P.S. The 1-minute Terminator Salvation teaser trailer encoded to 7,703KB with those settings =)

P.P.S. So a lot in advance.. and I also didn't get a chance to thank everyone from the last thread.... much appreciated Aha

(This post was last modified: 31/03/2009 07:11 AM by bboy_sonik.)
31/03/2009 05:32 AM
Find all posts by this user Quote this message in a reply
Diabelski Chojrak
Paradoxical Absurdity

Posts: 519.2183
Threads: 25
Joined: 5th Oct 2007
Reputation: 2.39014
E-Pigs: 29.9676
Offline
Post: #2
RE: MPEG-4 AVC/AAC... again!
U mind this?
[Image: lolnp6.png]
or this?:
[Image: snap005ag0.png]
This resolutions work fine on psp player. ;)

[Image: vitaavat4-1.png]
(This post was last modified: 31/03/2009 06:44 AM by Diabelski Chojrak.)
31/03/2009 06:42 AM
Find all posts by this user Quote this message in a reply
bboy_sonik
Byeeeeeeeeee

Posts: 132.3019
Threads: 8
Joined: 9th Aug 2007
Reputation: 0.76198
E-Pigs: 2.8344
Offline
Post: #3
RE: MPEG-4 AVC/AAC... again!
My videos work fine. Completely fine, nothing at all wrong with them. That isn't my question. I'm looking for any advice on optimizing the encoding in x264, that's all, to see if there is any options more suited or that I missed. To see if anyone has picked up some "neat tricks".

But thanks for the... umm... nice screenshots....
31/03/2009 07:10 AM
Find all posts by this user Quote this message in a reply
blessedhands
Paradigmatic Entity

Posts: 199.7880
Threads: 18
Joined: 15th Dec 2007
Reputation: -1.64513
E-Pigs: 26.8526
Offline
Post: #4
RE: MPEG-4 AVC/AAC... again!
bboy_sonik Wrote:My videos work fine. Completely fine, nothing at all wrong with them. That isn't my question. I'm looking for any advice on optimizing the encoding in x264, that's all, to see if there is any options more suited or that I missed. To see if anyone has picked up some "neat tricks".

But thanks for the... umm... nice screenshots....

hey man can u please upload your presets...
31/03/2009 08:01 AM
Visit this user's website Find all posts by this user Quote this message in a reply
bboy_sonik
Byeeeeeeeeee

Posts: 132.3019
Threads: 8
Joined: 9th Aug 2007
Reputation: 0.76198
E-Pigs: 2.8344
Offline
Post: #5
RE: MPEG-4 AVC/AAC... again!
Sure. Here you go. It's only one preset, for the settings I mentioned in my first post. Also, make sure you have the newest MediaCoder version (0.7.0 RC2).

Also, this is for widescreen source video's, even though it encodes at 640x480 it correctly displays in anamorphic on both the PSP and the PC (in Media Player Classic Homecinema at least, anyway, dunno about other players but probably ok). If the video you want to encode is 4:3 or whatever, just say so under Aspect setting (see screenshot).

[Image: mediacoderaspect.png]

Also note that to encode the 1-minute source video it took about 3 minutes on my PC. This might be too slow for most, but I can handle the wait as I usually encode my DVD movie overnight.

EDIT: I might have changed a couple of things in that preset since the original post, if I did it resulted in seemingly better quality but slightly slower encode (with similar filesize).

Hope Assassin or Zinga can give me some wisdom on this one, these guys know their x264 encoders ^_^


Attached File(s)
.zip  MPEG-4 AVC [PSP Compatible] [CQ 56, Slowest] [16-9].zip (Size: 1,009 bytes / Downloads: 198)
(This post was last modified: 31/03/2009 06:48 PM by bboy_sonik.)
31/03/2009 06:44 PM
Find all posts by this user Quote this message in a reply
blessedhands
Paradigmatic Entity

Posts: 199.7880
Threads: 18
Joined: 15th Dec 2007
Reputation: -1.64513
E-Pigs: 26.8526
Offline
Post: #6
RE: MPEG-4 AVC/AAC... again!
it took me forever(like 15-20mins xD) encoding a happy tree friends clip with your preset. hope you can make more presets...
31/03/2009 09:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
Offline
Post: #7
RE: MPEG-4 AVC/AAC... again!
You're archiving your DVDs at PSP resolution??

Anyways:
Quote:

Code:
# ".\codecs\x264.exe" "$(SourceFile)" --no-psnr --no-ssim --keyint 250 --min-keyint 25 --level 30 --me umh --merange 32  --no-fast-pskip --non-deterministic --aq-mode 1 --aq-strength 1.0 --b-adapt 2 --ref 16 --subme 9 --psy-rd 1:0 --bframes 16 --direct auto --mixed-refs --trellis 1 --b-pyramid --weightb --crf 22 --sar 4:3 --threads auto --partitions all -o "$(DestFile)"

merange 32 is overkill for PSP resolution in most cases.  I'd just leave at default.  But up to you.
Take out --non-deterministic - it's an experimental parameter.
PSP doesn't accept 16 reference frames (is this actually for the PSP?).
16 b-frames is usually overkill too.  8's already a pretty high number.  I probably would consider 6 fairly high in most cases too.
Don't use b-pyramid for PSP encodes - PSP doesn't render it properly.
Note that "sar" is pixel aspect ratio, not resulting aspect ratio...

If you're not doing this for PSP, take out the level param, add in 8x8dct.
01/04/2009 12:39 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Assassinator
...

Posts: 6,646.6190
Threads: 176
Joined: 24th Apr 2007
Reputation: 8.53695
E-Pigs: 140.8363
Offline
Post: #8
RE: MPEG-4 AVC/AAC... again!
I don't think he's encoding for PSP. He mentioned 1080p somewhere in there...


Machine generated command line? Looks sort of weird...

Pretty much some stuff zinga covered already....

That would take ages to encode. Too many B-frames. I mean you're encoding a real life movie. You'd only consider 16 B-frames for anime or something like that (even then, returns are very diminishing at the high end, so it's still questionable). Reducing the B-frames a bit massively increases speed (otherwise, use the old b-frame decision if you want to use 16 b-frames).

Negative deblocking if you're aiming for high bitrate archive encodes.    --deblock -2:-1
You also want to use adaptive DCT.    --8x8dct
trellis 2 if you're willing to sacrifice time for efficiency (hey, way better use of time than b-frames 16...).    --trellis 2


lol, level30? Doesn't exist. If I remember correctly, 5.1 is the highest level.
01/04/2009 12:45 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
Offline
Post: #9
RE: MPEG-4 AVC/AAC... again!
For the colour, could be your decoder.
Even with anime, 16 bframes is way overkill, from x264's stats.
I've read that x264's default deblocking is almost always PSNR optimal and x264 does automatically compensate for higher bitrates.  I guess negative deblocking might work better for anime content for sharper edges, rather than most live action content.

If you're archiving, I'd use Vorbis instead of AAC.  Q4 to Q6 for high quality - I typically use Q4 for DVD rips.
01/04/2009 03:23 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Assassinator
...

Posts: 6,646.6190
Threads: 176
Joined: 24th Apr 2007
Reputation: 8.53695
E-Pigs: 140.8363
Offline
Post: #10
RE: MPEG-4 AVC/AAC... again!
ZiNgA BuRgA Wrote:Even with anime, 16 bframes is way overkill, from x264's stats.

Yeah.... I sort of agree. Even for the very HQ encodes, I only use 12 these days. 8 for normal encodes. The time it takes to encode with 16b & b-adapt=2 just isn't worth it.

ZiNgA BuRgA Wrote:I've read that x264's default deblocking is almost always PSNR optimal and x264 does automatically compensate for higher bitrates.  I guess negative deblocking might work better for anime content for sharper edges, rather than most live action content.

Well, how I see it...

Deblocking goes to the effect of smoothing stuff (a selective smooth, but it's still smoothing stuff). If you're doing a high bitrate (e.g, Q16) encode that aims for transparency, firstly, for transparency's sake, you probably don't want to smooth stuff (you'd more interested in keeping eerything). Secondly, since you're using a very high bitrate, you would not end up with blocking anyway.

It's sort of, but not exactly, similar to the argument with the psychovisual stuff (psytrellis, psyrdo). Using them definitely gives you worse quality metrics (PSNR and stuff). Main argument here is that humans perceive stuff differently from the metrics. To metrics, smooth = less noise = less difference = good. To humans, not nessesarily.

But whatever, it's personal preferrence, everyone's tastes are different. I'm not assuming every encoder to do exactly the same thing. m.3.3w uses 1:1. gg uses -1:0, THORA uses -3:-3 (« this one seems a bit weird). Differs with different shows too.
(This post was last modified: 01/04/2009 04:12 AM by Assassinator.)
01/04/2009 03:46 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

 Quick Theme: