digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   FFMPEG vs FFVFW vs Mencoder ? (http://www.digitalfaq.com/archives/encode/8159-ffmpeg-vs-ffvfw.html)

bilu 03-22-2004 10:02 AM

My new default settings, work for PAL and NTSC, live movies and anime:

Quote:

BATCH
====
PAL: mencoder -include settings.ini -lavcopts keyint=15 movie.vob -o movie.m2v
NTSC: mencoder -include settings.ini -vf-pre softpulldown -lavcopts keyint=18 movie.vob -o movie.m2v

SETTINGS.INI
========
of=rawvideo=1
ovc=lavc=1
nosound=1
noskip=1
vf=yuvcsp
lavcopts=vcodec=mpeg2video:vrc_buf_size=1835:preme =2:precmp=2:
intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,2 9,34,37,12,14,18,27,
29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39 ,38,40,48,27,29,34,
37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40 ,48,58,69,79:
inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,2 6,28,30,32,20,22,24,
26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32 ,34,34,36,38,26,28,
30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34 ,36,38,40,42,44:
vrc_minrate=300:vbitrate=9800:vrc_maxrate=9800:ild ct=1:ilme=1:
vstrict=-1:ildctcmp=2:autoaspect=1:vqcomp=1:vqblur=0:p_mask =1:
scplx_mask=0.15
Most important changes: abandoned the denoiser and decreased the scplx_mask value. Quality is very good and detail is preserved even on anime IMHO. It's also faster, between 9/10 fps (PAL) on a PIII-500.

I abandoned the denoiser after some underwater scene encodes from "The Abyss". These scenes are very sensitive to denoisers.

These settings aim at quality, not at bitrates. To aim at better bitrates increase scplx_mask until 0.3, but not in anime.

On anime you can only count with denoisers, but don't expect much more than a 200/300 Kbps gain.


Bilu

digitall.doc 03-22-2004 11:09 AM

Quote:

Originally Posted by bilu
These settings aim at quality, not at bitrates. To aim at better bitrates increase scplx_mask until 0.3, but not in anime.

By quality (and not bitrates) do you mean low quantizers and high or low bitrates?.
So p_mask averages inter-MB quantizers, hmmm... do you understand what does that mean? If you know how, please, put it in plain words (english, spanish, portuguese, don't mind, since the definition sounds chinese to me :? , since I'm not an expert on this :cry: ) I see you employ it at maximum value, what does it on quantizers/bitrate/filesize?. Did you test it together with naq (if you think is of a help)?

Well, now we are almost using the same command (instead of vqcomp=1 I use vrc_eq=tex: the same). I use also cmp and subcmp=2, don't know if it really helps (did you test them?). And was using mbd=2 (you use default=1, don't you), have to test differences with and without. And also was using predia and dia=-2 (from man_page: adaptive and faster): did you make a test?.

Sorry if I ask too much, but I have lot of things to do now, and if you already did the tests I avoid to repeat them (even I still think we get different results due to different sources).

bilu, do you have any clue to make your compilation work with vobs in my PC? (nice question, isn't it? :lol: ) since with vmesquita compilation it works (with no filter, up to 17 fps 8O 8O , no trellis no mbd=2 of course).
Please, make me now if you think in a way to solve this (didn't try yet amnon compilation you advised me... the only solution?)

bilu 03-22-2004 11:44 AM

New version, and maybe the last :)

By using mbd=2 and no denoisers I can use scplx_mask up to 0.25 with acceptable quality in anime. Trellis brought no noticeable improvements to the ringing problem I was having in anime with scplx_mask, so I won't use it.

Quote:

of=rawvideo=1
ovc=lavc=1
nosound=1
noskip=1
vf=yuvcsp
lavcopts=vcodec=mpeg2video:vrc_buf_size=1835
:vrc_minrate=300:vbitrate=9800:vrc_maxrate=9800
:ildct=1:ilme=1:vstrict=-1:ildctcmp=2:autoaspect=1
:vqcomp=1:vqblur=0:p_mask=1:scplx_mask=0.25
:preme=2:precmp=2:mbd=2:mv0=1

:intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,
29,34,37,12,14,18,27,29,34,37,38,22,26,27,31,36,
37,38,40,26,27,29,36,39,38,40,48,27,29,34,37,38,
40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48
,58,69,79:inter_matrix=16,18,20,22,24,26,28,30,18,
20,22,24,26,28,30,32,20,22,24,26,28,30,32,34,22,
24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,
28,30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,
32,34,36,38,40,42,44
So this one now works on every source I have :)

Bilu

bilu 03-22-2004 12:00 PM

Quote:

Originally Posted by digitall.doc
By quality (and not bitrates) do you mean low quantizers and high or low bitrates?.
So p_mask averages inter-MB quantizers, hmmm... do you understand what does that mean? If you know how, please, put it in plain words (english, spanish, portuguese, don't mind, since the definition sounds chinese to me :? , since I'm not an expert on this :cry: ) I see you employ it at maximum value, what does it on quantizers/bitrate/filesize?. Did you test it together with naq (if you think is of a help)?

It averages P-frame quantizers, don't know if it does it spatially (averaging MBs on a certain region of the frame) or temporally (averaging the macroblocks in the same region for a certain number of frames).
But it increases quality, bitrate and filesize a bit. A good thing to counterbalance the effect of scplx_mask, but not as bad as naq.

I won't use naq anymore because it renders the *_mask parameters useless. :roll:

Quote:

Well, now we are almost using the same command (instead of vqcomp=1 I use vrc_eq=tex: the same). I use also cmp and subcmp=2, don't know if it really helps (did you test them?). And was using mbd=2 (you use default=1, don't you), have to test differences with and without. And also was using predia and dia=-2 (from man_page: adaptive and faster): did you make a test?.
cmp and subcmp make encoding slower and don't improve as much as trellis or mbd=2, at least that's what I read in the mailing list.
Bigger diamonds don't necessarily increase PSNR and sometime decrease it, and it's slow. Also read in the mailing list.

Quote:

bilu, do you have any clue to make your compilation work with vobs in my PC? (nice question, isn't it? :lol: ) since with vmesquita compilation it works (with no filter, up to 17 fps 8O 8O , no trellis no mbd=2 of course).
Please, make me now if you think in a way to solve this (didn't try yet amnon compilation you advised me... the only solution?)
What errors do you have?
Have you tried more than one VOB source?

Bilu

digitall.doc 03-22-2004 12:29 PM

Quote:

Originally Posted by bilu
What errors do you have?
Have you tried more than one VOB source?

The error I get is a Windows warning screen (I don't remember now the exact text, something about a number 000e45g0x0 or something, and the text software exception error at other number) and when I accept it closes the cmd window. Right at the begining of encoding (after displaying all mencoder messages)
About the source, I tried several vobs from the same film. But I don't think it's a matter of source, since with this source I managed to encode with no problem with vmesquita compilation...
I would like to test it with vobs, and begin to try different mplayer filters, to see how to get similar results to avisynth...
Don't know if you can help. Is it possible I have a library or something missing you already have, and that's why I can't use it?. But, again, don't think so since with vmesquita's I could. It must be something in the compilation you did, maybe you didn't include something... is it possible?.

bilu 03-22-2004 12:34 PM

How about trying to compile yourself? :)
Follow the instructions I posted and post any doubt you have.

This way it should be compatible with all your CPU features for sure! :lol:


Bilu

digitall.doc 03-22-2004 02:38 PM

Quote:

Originally Posted by bilu
How about trying to compile yourself? :)
Follow the instructions I posted and post any doubt you have.

This way it should be compatible with all your CPU features for sure! :lol:


Bilu

Yep, that would be a good solutions, and your explanations were clear enough. But I don't have that time now, and I'm afraid that if rds met some trouble, it will take me a lot of time. :roll:

digitall.doc 03-25-2004 10:35 AM

... everything is so quiet around here...

As I always do, everytime a new tool is recomended, I don't mind to test it...

And I did with QuEnc.
Film: Star Wars II, 5% slicer
- First QuEnc test: I didn't really know what bitrate was for, so I used bitrate=9800, plus: Notch matrix, 16:9 aspect, High quality, trellis, GOP=15
Result: perfect!!... bitrate max 7661, avg 2383, Q max 3.48, avg 2.60 (almost flat, like vqscale=2.60),... but filesize=122740 kB (2454800 the whole film, 1 film per media)... not that good
- Second QuEnc test: bitrate=1620, rest of values as previous test.
Result: bitrate max 3071, avg 1522, Q max 12.40, avg 4.34. Filesize=78412 kB (better). But it fails badly in fast scenes, with lots of blocks.
- I compared with a mencoder test: filesize 78566 kB (almost equal), bitrate max 4740, avg 1525, Q max 4.35, avg 3.56. And a lot better visually (almost don't see a block).

Why don't I post there?: I want people test and take their own conclusions.
And QuEnc gave me several lessons:
- You almost don't need to test filesize: just set avg bitrate and final filesize seems to be close to desired. We still have to improve mencoder method to be as simple.
- Really easy to use interface: we DO need a GUI for mencoder. I have some knowledge on VisualBasic, but don't think that's the way to generate a command line and run mencoder... at least I don't know how. Mencoder command-line is rough for everybody, that's why very little people seems to be using/posting on it. And now that we came to some general settings, we would just need few variables to be set in the GUI. Any help?, or some idea to design myself a GUI with (bad) VisualBasic.
- It integrates very well avs files. I hope mencoder developers will include it soon.
- Even with those too big quantizers (up to 12.40), when quantizer decreases it get as low as about 2.90. But with mencoder and scplx_mask, didn't go under 3 (even with vqmin=2)
- Fast, fast?. I got a speed about 7.25 fps, and with mencoder 5-6 fps: not a big difference.

To sum up, maybe mencoder looks far complicated compared to QuEnc: yes it is. But its complexity is due to the several variable you can define... and this means at last better quality. I prefer to have more values to take out the best from ffmpeg engine, and that's what mencoder offers me. If we manage to design a nice GUI with some basic settings, and a window to tweak more of them, surely more people would be using mencoder.

At least, for me, mencoder is giving better quality now.

Abond 03-25-2004 10:48 AM

Quote:

Really easy to use interface: we DO need a GUI for mencoder.
Would you mind to try with Avalon's GUI?

Jellygoose 03-25-2004 12:35 PM

Let me just chime in here...
Haven't been looking into mencoder yet, but I'd like to know if it IS possible with mencoder to encode with a max/min bitrate, which is respected by the encoder... I remember ffvfw lacks this feature.

bilu 03-25-2004 01:05 PM

It respects min and max, just not average ;)

EDIT: QuEnc works with filesize well because it sets vrc_minrate=vrc_maxrate=vbitrate. It's CBR :!:

They still complain about undersized files when using VBR.


Bilu

digitall.doc 03-25-2004 04:37 PM

Quote:

Originally Posted by bilu
EDIT: QuEnc works with filesize well because it sets vrc_minrate=vrc_maxrate=vbitrate. It's CBR :!:

I didn't know. In the graphic I got in BitrateViewer I could see more oscilations in Q value than in bitrate value (I set 1620 and it oscilated between 1000 and 2000). I expected from a constant bitrate a straight bitrate curve, but I see it's not that.

Bilu, what about designing our own GUI for mencoder, with general settings as we have agreed, and more settings to modify and adjust than in QuEnc?. Yes, I know, I know, I shouldn't propose it since I cannot help much,... but I love the idea :wink: Have you read in mencoder forums if they're thinking about including support for avs files?.

And about average bitrate, mencoder doesn't respect it, but tends to it. The problem is for predicting filesize, but we have several tools for that...

digitall.doc 03-25-2004 05:19 PM

Quote:

Originally Posted by Abond
Quote:

Really easy to use interface: we DO need a GUI for mencoder.
Would you mind to try with Avalon's GUI?

Don't mind at all to test anything. Mencoder compilation was also advised by bilu, to solve my vob encoding issue (still to be solved :roll: )
The problem is I don't like at all to test applications that come with an installer (registry entries and so on). Even mencoder compilation comes with an installer!!.
It's just a question of taste, I prefer plain applications/compilations in which I decide what things I install/execute and what not.
Thanx a lot, anyway.

incredible 03-25-2004 05:52 PM

:arrow: :wink: exact!

digitall.doc 03-25-2004 06:31 PM

Hi inc,
nice to see you here :D .
From some of your posts I guess you're also testing mencoder. What do you think of the settings we've tested here?. And what about the settings you tested, and your results?.
We would like to know how you work with mencoder, and learn from you :) .

poerschr 03-25-2004 06:50 PM

Yea guys...I found some interesting info..check this out, if you have not already done so...its about conversion from DVD to MPEG4, but can be applied to mpeg2 as well....one interesting idea is the settings recommended by D Rich Felker that the author mentions....

http://users.uoi.gr/ch02029/ffvfw/encoding-tips.txt

poerschr 03-25-2004 07:43 PM

Has anyone tested encoding with the "vhq" setting enabled? I was curious how this changes the speed of the encoding process...

bilu 03-26-2004 03:10 AM

@poerschr

that's the same file as this:
http://www.mplayerhq.hu/DOCS/tech/encoding-tips.txt

It's old but still useful, and has been quoted here several times.
It has some very good info on it about *_mask settings and others.

vhq is the same as mbd=1, and it's maintained just for compatibility reasons.


Bilu

digitall.doc 03-26-2004 07:14 AM

bilu,
from your posts I guess you make use of bat and ini files, not GUI at all.

What do you think about designing one that fit our needings?. Any idea?.

bilu 03-26-2004 07:28 AM

If I have the time to learn WxPython, then I'll do a GUI :)

WxPython= cross-platform GUI, same used in BitTorrent client.

I've been out of time for everything these days...

Bilu


All times are GMT -5. The time now is 04:20 AM  —  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.