digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   Mencoder: MEncoding DivXs/DVDs using 2 pass VBR (http://www.digitalfaq.com/archives/encode/9044-mencoder-mencoding-divxs.html)

vmesquita 04-10-2004 07:22 PM

@bilu,
Tried mvo=1, but as the manpage suggest, make no difference with mbd=0. So I tried mbd=2:mv0=1 and got a bad result. I am now going to try "lmin=1:scplx_mask=0.4" with my best settings so far to see if it improves.

@digitall.doc
I followed the mencoder thread for a while in the begging but later I stopped reading and participating, because I was having too many issues with mencoder, looked very instable to me in the past. Not anymore. :D
I am using a DVD source to do the tests (the Lawmmover Man trailer, great movie BTW), to make sure any artifacts are not coming from the source. :wink:

kwag 04-10-2004 07:31 PM

Quote:

Originally Posted by vmesquita
@bilu,
Tried mvo=1, but as the manpage suggest, make no difference with mbd=0.

Hey vmesquita,

Take a look at the source code of the encoder. It's more interesting than anything the MAN pages will ever tell ;)

-kwag

vmesquita 04-10-2004 07:37 PM

@kwag
Great idea, I'll do that later, it should be very interesting. 8O 8)

@bilu
"lmin=1:scplx_mask=0.4" created a output with slighly more artifacts. I'll try lmin=1:scplx_mask=0.249 just to be complete. I think I am very near to my optimal settings! :D 8)

<edit>I made a mistake, I'll re-do the test.

vmesquita 04-10-2004 08:40 PM

Looks like the best ssettings (at least with the trailer I am testing) is really ":scplx_mask=0.3:lmin=1:"
Now a very interesting data: I encoded the same trailer, using CCE in 2-Pass VBR. CCE encode was not bad, but much inferior to mencoder. Much more DCTs and mosquitos. With this latest settings, artifacts are near gone in mencoder encode. Also CCE has problems with fades, which mencoder doesn't, this is very visible. I'll post some screenshots later.

Also I found out what was making prediction go crazy: looks like specifying vrc_minrate causes that (not max_rate). I'll test with other stuff to see if vbitrate is working fine when vrc_minrate is not used or this was just coincidence.

Thanks bilu and digitall.doc for all the tips and previous tests :D :D :D I'll update the first post with my final settings (for now). :wink:

bilu 04-10-2004 08:55 PM

Quote:

Originally Posted by vmesquita
Also I found out what was making prediction go crazy: looks like specifying vrc_minrate causes that (not max_rate). I'll test with other stuff to see if vbitrate is working fine when vrc_minrate is not used or this was just coincidence.

Not coincidence, just made that same test over the same stream I used for the screenshots. Used my settings but removed vrc_minrate, it got to an average of 2868 kbps.

I'll make my tests all over again :roll:

Bilu

vmesquita 04-10-2004 09:00 PM

Quote:

Originally Posted by bilu
Used my settings but removed vrc_minrate, it got to an average of 2868 kbps.

But what was your target? 3000? I am currectly encoding a bigger AVI (20 minutes, my test trailer was only 2 minutes long) to see what happens.

<edit> I checked the last thread you posted later (the one with BV screenshots), and seems that you are aiming for 3000. It's not bad for 1 pass. Also you have to take on account that sometimes it's impossible to rise bitrate, because mencoder is already using the lower quantisizer possible. This AVI I am testing now I saw this happening (opened in BV and confirmed the hypotesis). So I rised the target resolution from 352x480 to 480x480 and now, with 70% of first pass completed, average is 999! :D :D :D

<edit2> Bitrate in first pass: 971.55 Bitrate in Second Pass: 1000.143! Amazing! :D :D :D
<edit3>Just for fun, I did the whole "Lawnmover man" movie from DVD to a 352x480 KSVCD. I asked for 873 kbits, got 871 in the first pass and 873 in the second pass, with an average quantisizer of 2.34. And the bitrate has been respected, max in BV was 2873 (I asked for 2500), but we all know BV is not that accurate. To achive that, there has been quantization peaks of 13.08!!!

bilu 04-11-2004 05:55 AM

@VMesquita

Re-did a lot of testing.

Extensive tests without vrc_minrate
http://www.kvcd.net/forum/viewtopic.php?t=10229


Bilu

digitall.doc 04-12-2004 11:07 AM

Quote:

Originally Posted by kwag
Quote:

Originally Posted by vmesquita
@bilu,
Tried mvo=1, but as the manpage suggest, make no difference with mbd=0.

Hey vmesquita,

Take a look at the source code of the encoder. It's more interesting than anything the MAN pages will ever tell ;)

-kwag

Well, if you take some conclusions looking at the source code, make us know, since I'm surprised with results I get from time to time, opposite (in a way) to what I expected...

BTW, already tested your compilation (run time version for me, P4), and is FAST: about 27 fps in each pass, just double of real-time in two-passes!!

vmesquita 04-12-2004 01:43 PM

@digitall.doc
And it can get even faster, if you could recompile it to support SSE and SSE2 (but not 3dNow!). I'll make a recompiling guide (or maybe I should do multiple compilations), just give me some time. :wink:

digitall.doc 04-12-2004 04:32 PM

Quote:

Originally Posted by vmesquita
I'll make a recompiling guide (or maybe I should do multiple compilations), just give me some time. :wink:

Very helpful (mainly the last) for those of us that are... how could I say, :dunce: :?:

digitall.doc 04-14-2004 05:33 AM

Hi all,
I've been testing a lot lately with mencoder 2pass to encode KDVD.
With barebones command and setting, I get about 26 fps in each pass, that means I finish 2 pass in less time it lasted with 1 pass and my last settings (I was getting 12 fps as much). And really accurate final file size.
So, it's fast and accurate... but that's not all, of course. I've been doing my tests with StarWars II (1 h 16 min 40 sec), so to fit this film twice (2 films per media) with 2 audio tracks (1 ac3 5.1 and 1 ac3 2.0) and a subtitle file, I calculated an average bitrate about 1500. So I did my tests with vbitrate=1500. I know this may be an extreme case, but wanted to see the output.
With barebones command and setting, no filter, it was fast as reported. And when seen in PC doesn't look bad, very homogeneus. But it's not good at all, I see lots of microblocks (don't know if this is the correct term, but they're not macroblocks, and affect the whole image).
I tried adding mbd=2:mv0=1 and quantizers raised a bit, and I think I saw more gibbs effects (I think they are, I don't really know how a gibb looks like). Encoding slowed from 26 to 20 fps. And kept seeing microblocks.
I tried instead with trell=1:cbp=1, and quantizers lowered a bit, bitrate raised a bit (respected average bitrate), and little slow down in speed ( from 26 to 24). But still microblocks (I cannot say if little less).
Tried then with scplx_mask and tcplx_mask, but I think even worse.
I tried with trell=1:cbp=1:mbd=2:mv0=1, that slowed down a lot the speed (to about 16 fps) and didn't improve the microblock problem.
... so I'm afraid I took the best out of mencoder 2pass for KDVD and vbitrate=1500. Maybe it's an extreme case, and maybe this won't be noticeable later when seen on TV. But I would like to improve the output: do you know how?.
I got better results with 1pass, but of course with higher average bitrate and file sizes, that wouldn't fit what I'm asking know to mencoder 2pass.
Any ideas how can we improve this?

Don't take me wrong: I'm really very satisfied with mencoder 2pass, and I think that's the way. I just did a difficult test, and want to know it is there a way to make it look better.

Jellygoose 04-15-2004 07:14 AM

oK vmesquita please make some things clear for me about 2-pass encoding with mencoder.

Here are my problems. When I encode a movie with vpass=2, mencoder will immediately close, without starting to encode.
When I set it to vpass=1, mencoder will create a .m2v file, together with a growing dvx2pass.log file.
When I abort that encode, set mencoder back to vpass=2, the encoder will start, but will only encode until that amount of percentage I already encoded with vpass=1 (I figure it crashes when it has read the divx2pass.log until the end).

Now please tell me how can I automate that process? where's the trick? I don't want to do a manual first pass and a manual second pass... :roll:

vmesquita 04-15-2004 07:23 AM

There's no way to run mencoder only once and make it do 2 passes. You have to call it twice. But you can automate the process easily by using my GUI ( that you already know, there's a new release out ) or creating a batch file. :wink:

Jellygoose 04-15-2004 07:26 AM

Alright, now I understand. phew... :lol:

But why is mencoder creating an m2v file in first pass? isn't it supposed to write just a log for the second pass? :roll:

vmesquita 04-15-2004 07:33 AM

I just figured out: use -o NUL in the first time. This way it won't create the 1-pass file, just the logfile. I don't know if it's faster. :?

EDIT: A quick tes: looks like -o NUL is slower :!: Well, maybe was just this time. :D

Jellygoose 04-15-2004 08:46 AM

Thank you VM...
This is getting fun now. I LOVE the quality this two-pass beast spits out. Ever thought about 3-pass? :lol:

vmesquita 04-15-2004 09:00 AM

Quote:

Originally Posted by Jellygoose
Thank you VM...
This is getting fun now. I LOVE the quality this two-pass beast spits out. Ever thought about 3-pass? :lol:

This would be fun... :D Unfortunatelly, mencoder doesn't update the logfile in second pass so no 3-Pass is possible. :roll:

bilu 04-15-2004 09:13 AM

3-pass info:

http://www.mplayerhq.hu/DOCS/HTML/en...eat-divx4.html


Bilu

incredible 04-15-2004 09:22 AM

Quote:

Originally Posted by vmesquita
I asked for 873 kbits, got 871 in the first pass and 873 in the second pass, with an average quantisizer of 2.34.

Be aware, that Bitrateviewer and its outputted Qunatizer doesn't stand for resulted "viewable" image quality! So only do compare the encoding using your eyes!

As already said, I did see that on tests this week using CCE 2.50. CCE2.6x, TmpgEnc and mencoder.
If you choose "linear qunatizer scale" in CCE 2.50 a "wonderful" q curve of 1 constantly! comes out where the bitrates also are ok. BUT it did look even worse than the same parameters and low VBR avg bitrate used in TmpgEnc but non linear Quantizer (tmpgEnc default) which resulted in a average Q of 3.5 !!! with peaks up to 6!!
So the output from Bitrateviewers Q curve does say something different ... maybe how the quality of the stream how it will be descrambled by the decoding and therefore the usage of the matrix posted in the m2v! Means perfect descrambling BUT does NOTHING say about the quantisation DURING the encoding ..... maybe thats the reason?!

digitall.doc 04-15-2004 09:54 AM

Hi all.
Sorry me for being so impatient. I posted my tests with two passes in this same thread, previous page. And posted there some results and some problems I found.
Just wanted to know if is there any way :idea: to improve the results I got.


All times are GMT -5. The time now is 12:14 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.