High quality encoding of anime and broken mencoder options
Hi. I seek high quality encoding of anime. I have tested many encoding options, always with vcodec=mpeg4 and 2-pass encoding. I have found that even with vbitrate, the actual bitrate depends on the options used. Therefore, to keep the comparison fair, I have measured encoding quality by Q=PSNR/bitrate, with bitrate in Mbits/s. The test source is a 105 MB avi file with FFV1 video and no audio. The video is 1201 576x432 frames at 25fps. Some of my results: Very fast: time mencoder -o result.avi -ovc lavc -lavcopts vcodec=mpeg4:psnr:vbitrate=512:vpass=2 testsource.avi Video stream: 538.354 kbit/s (67294 B/s) size: 3232815 bytes 48.040 secs 1201 frames PSNR: Y:33.86, Cb:37.82, Cr:37.20, All:34.77 real 0m30.771s user 0m27.979s sys 0m0.608s u+s=28.587, fps=42.01, PSNR/bitrate=64.59 High quality: time mencoder -o result.avi -ovc lavc -lavcopts vcodec=mpeg4:psnr:vbitrate=512:keyint=300:vmax_b_frames=2:vb_strategy=1:b_sensitivity=10:trell:v4mv:mbd=2:vpass=2 testsource.avi Video stream: 510.746 kbit/s (63843 B/s) size: 3067029 bytes 48.040 secs 1201 frames PSNR: Y:34.89, Cb:38.66, Cr:38.03, All:35.77 real 0m44.823s user 0m41.348s sys 0m0.788s u+s=42.136, fps=28.5, PSNR/bitrate=70 Excellent quality: time mencoder -ovc lavc -o result.avi -lavcopts vcodec=mpeg4:psnr:vbitrate=512:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=3:dia=3:vmax_b_frames=2:vb_strategy=1:b_sensitivity=10:mbcmp=2:qpel:preme=2:keyint=300:vpass=2 testsource.avi Video stream: 498.805 kbit/s (62350 B/s) size: 2995322 bytes 48.040 secs 1201 frames PSNR: Y:35.48, Cb:38.85, Cr:38.26, All:36.28 real 1m32.845s user 1m30.364s sys 0m0.943s u+s=91.307, fps=13.15, PSNR/bitrate=72.73 Now, 1) Do you think the above settings are wise? Any suggestions? 2) When reencoding a movie with slight compression artifacts, should I use -vf pp=ac? Note that I will use it when reproducing anyway; I am asking if I should also use it during encoding. 3) The option vrc_override should be useful, but does not work. That should be added to the documentation. Thank you for your attention! -- Software is like sex: it is better when it is free. --Linus Torvalds
Le sextidi 16 ventôse, an CCXVI, Jorge Peixoto de Morais Neto a écrit :
Hi. I seek high quality encoding of anime. I have tested many encoding options, always with vcodec=mpeg4 and 2-pass encoding. I have found that even with vbitrate, the actual bitrate depends on the options used. Therefore, to keep the comparison fair, I have measured encoding quality by Q=PSNR/bitrate, with bitrate in Mbits/s.
I believe that your Q value is not relevant: why PSNR/bitrate rather than PSNR²/bitrate or PSNR/bitrate², or PSNR/log(bitrate) or... PSNR itself is a logarithm of mean square error, there is no reason that a simple division should be the relevant measure. There is a case where the results are certain; if bitrate(A) <= bitrate(B) while quality(A) >= quality(B), then it is certain that the settings for A are better (quality-wise) that the settings for B. Fortunately, in your tests, you are precisely in this case. If this is not true, then you have to vary your target bitrate until you can compare, or plot curves and see which one is above the other.
Excellent quality: secs 1201 frames PSNR: Y:35.48, Cb:38.85, Cr:38.26, All:36.28
I would not call that "excellent quality": I like my videos well above PSNR 40.
1) Do you think the above settings are wise? Any suggestions?
Do you insist on using simple MPEG-4? H.264 gives much better results. Shameless plug: You may be interesting by a look at <URL: http://www.normalesup.org/~george/comp/video_quality/
. I have a second part in this experiment waiting to be published, where I explore the effect on quality and time of the various encoding options, but it still requires some work.
Regards, -- Nicolas George
Hi. I seek high quality encoding of anime. I have tested many encoding options, always with vcodec=mpeg4 and 2-pass encoding. I have found that even with vbitrate, the actual bitrate depends on the options used. Therefore, to keep the comparison fair, I have measured encoding quality by Q=PSNR/bitrate, with bitrate in Mbits/s.
I believe that your Q value is not relevant: why PSNR/bitrate rather than PSNR²/bitrate or PSNR/bitrate², or PSNR/log(bitrate) or... PSNR itself is a logarithm of mean square error, there is no reason that a simple division should be the relevant measure. The Shannon-Hartley theorem (http://en.wikipedia.org/wiki/Shannon-Hartley_theorem) suggests to me that information is proportional to the PSNR (I know I am stretching things here, and I may be wrong).
There is a case where the results are certain; if bitrate(A) <= bitrate(B) while quality(A) >= quality(B), then it is certain that the settings for A are better (quality-wise) that the settings for B. Fortunately, in your tests, you are precisely in this case.
If this is not true, then you have to vary your target bitrate until you can compare, or plot curves and see which one is above the other. Not feasible for me. I took many hours to perform the tests the way I did. It would take much more to perform them the way you suggest.
Excellent quality:
secs 1201 frames PSNR: Y:35.48, Cb:38.85, Cr:38.26, All:36.28
I would not call that "excellent quality": I like my videos well above PSNR 40.
1) Do you think the above settings are wise? Any suggestions?
Do you insist on using simple MPEG-4? H.264 gives much better results. As far as I know, H.264 would take too much time to encode. Also, I don't like patent-encumbered codecs. I assume that MPEG-4 part 2
I call excellent quality because I achieved a high PSNR for the bitrate. Also, I am not a "videophile". The quality of the file above is high enough that, when watching with -vf pp=ac, I can hardly notice the compression artifacts even if I examine it very closely. patents will run out before those of H-264, so it is "less evil". Too bad mencoder does not support Theora. ffmpeg2theora is a bit raw to my perfectionist needs. In any way, MPEG-4 part 2 is more compatible with players.
Shameless plug: You may be interesting by a look at <URL: http://www.normalesup.org/~george/comp/video_quality/
. I have a second part in this experiment waiting to be published, where I explore the effect on quality and time of the various encoding options, but it still requires some work.
Thank you very much, I will look into that.
On Wed, Mar 05, 2008 at 12:37:29PM -0300, Jorge Peixoto de Morais Neto wrote:
Hi. I seek high quality encoding of anime. I have tested many encoding options, always with vcodec=mpeg4 and 2-pass encoding. I have found that even with vbitrate, the actual bitrate depends on the options used. Therefore, to keep the comparison fair, I have measured encoding quality by Q=PSNR/bitrate, with bitrate in Mbits/s.
I believe that your Q value is not relevant: why PSNR/bitrate rather than PSNR²/bitrate or PSNR/bitrate², or PSNR/log(bitrate) or... PSNR itself is a logarithm of mean square error, there is no reason that a simple division should be the relevant measure. The Shannon-Hartley theorem (http://en.wikipedia.org/wiki/Shannon-Hartley_theorem) suggests to me that information is proportional to the PSNR (I know I am stretching things here, and I may be wrong).
Amount of information and quality are not necessarily very close when it comes to human perception.
1) Do you think the above settings are wise? Any suggestions?
Do you insist on using simple MPEG-4? H.264 gives much better results. As far as I know, H.264 would take too much time to encode. Also, I don't like patent-encumbered codecs. I assume that MPEG-4 part 2 patents will run out before those of H-264, so it is "less evil". Too bad mencoder does not support Theora. ffmpeg2theora is a bit raw to my perfectionist needs. In any way, MPEG-4 part 2 is more compatible with players.
There's no reason to believe that Theora is any less patent-encumbered than any other codec, except Xiph/On2 propaganda. Most of the algorithms it uses are identical to other codecs with plenty of patent claims against them. Considering 'patent-encumbered' formats as evil is very wrong anyway, IMHO. It's something like saying you want to avoid [insert random ethnic/religious/national/etc. group here] because [insert same] are oppressed. It's the oppressor, not the oppressed, whom you should boycott. As long as you're using free software like MPlayer, FFmpeg, x264, Xvid, etc. for your video encoding and decoding needs, you're not funding the patent trolls, only asserting your rights to make use of human knowledge. Rich
On Wed, 5 Mar 2008, Rich Felker wrote:
On Wed, Mar 05, 2008 at 12:37:29PM -0300, Jorge Peixoto de Morais Neto wrote:
Hi. I seek high quality encoding of anime. I have tested many encoding options, always with vcodec=mpeg4 and 2-pass encoding. I have found that even with vbitrate, the actual bitrate depends on the options used. Therefore, to keep the comparison fair, I have measured encoding quality by Q=PSNR/bitrate, with bitrate in Mbits/s.
I believe that your Q value is not relevant: why PSNR/bitrate rather than PSNR²/bitrate or PSNR/bitrate², or PSNR/log(bitrate) or... PSNR itself is a logarithm of mean square error, there is no reason that a simple division should be the relevant measure.
The Shannon-Hartley theorem (http://en.wikipedia.org/wiki/Shannon-Hartley_theorem) suggests to me that information is proportional to the PSNR (I know I am stretching things here, and I may be wrong).
Amount of information and quality are not necessarily very close when it comes to human perception.
You don't even have to get into psychovisual arguments. PSNR/bitrate is wrong because a _factor_ of X in bitrate corresponds to a _difference_ of Y in PSNR, for some content- and codec-dependent values of X and Y. And you don't need theory to prove this, just encode something at multiple bitrates. --Loren Merritt
Hi. I seek high quality encoding of anime. I have tested many encoding options, always with vcodec=mpeg4 and 2-pass encoding. I have found that even with vbitrate, the actual bitrate depends on the options used. Therefore, to keep the comparison fair, I have measured encoding quality by Q=PSNR/bitrate, with bitrate in Mbits/s.
I believe that your Q value is not relevant: why PSNR/bitrate rather than PSNR²/bitrate or PSNR/bitrate², or PSNR/log(bitrate) or... PSNR itself is a logarithm of mean square error, there is no reason that a simple division should be the relevant measure. PSNR/bitrate is wrong because a _factor_ of X in bitrate corresponds to a _difference_ of Y in PSNR, for some content- and codec-dependent values of X and Y. And you don't need theory to prove this, just encode something at multiple bitrates. I have tested this and it seems to be true. Thank you for this information. It suggests that the PSNR is a linear function of log(bitrate). I have tested this theory for three sets of encoding options. For each set, I encoded with bitrate 384, 512, 768 and 1024, resulting in 4 points of the form (log(bitrate),PSNR). In all three cases, the 4 points fitted very well on a straight line! Interesting.
Based on this, I have devised a better way of measuring "ecoding quality". For each set of options, I encode with vbitrate=512 and vbitrate=640. I then take the resulting PSNR and bitrate, take the log of the bitrate, and interpolate to calculate what bitrate I would need for my desired PSNR. I am remaking my tests based on this. So far, the best I have is (excluding certain settings that are too slow) vcodec=mpeg4:psnr:keyint=300:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:mbcmp=2:cbp:mv0:preme=2:vqcomp=0.6 vbitrate=512: bitrate=507.935, PSNR=36.44 vbitrate=640: bitrate=637.676, PSNR=37.83 bitrate for 36.4 PSNR would be 504.620867953 In my case, the mbcmp=2 option is helpful, but setting any other comparison function to 2 only makes things worse. Weird. -- Software is like sex: it is better when it is free. --Linus Torvalds
On Thu, 6 Mar 2008 17:51:24 -0300 Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> wrote:
In my case, the mbcmp=2 option is helpful,
mbcmp=<0-2000> Sets the comparison function for the macroblock decision, *only used if mbd=0.*
but setting any other comparison function to 2 only makes things worse.
I hope you aren't basing your decisions just on PSNR. There are innumerable situations where PSNR numbers are quite the opposite of perception. Read the man page entry about qns for an example. Or better yet, look at On2's marketing of their codecs, getting ridiculously high PSNR numbers, despite terrible quality.
On Fri, 07 Mar 2008 08:57:57 -0800 RC <cooleyr@gmail.com> wrote:
On Thu, 6 Mar 2008 17:51:24 -0300 Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> wrote:
In my case, the mbcmp=2 option is helpful,
mbcmp=<0-2000> Sets the comparison function for the macroblock decision, *only used if mbd=0.* Then the documentation is wrong or there is a bug in mencoder. I have tested it more than once. One of my early results:
vcodec=mpeg4:psnr:keyint=300:vmax_b_frames=2:vb_strategy=1:b_sensitivity=10:mbd=2:trell:v4mv:last_pred=3:dia=-1 with vbitrate=512: bitrate 512.661 , PSNR 36.01 in 46.661s with vbitrate=640: bitrate 642.454 , PSNR 37.38 in 48.186s bitrate for 36.4 PSNR would be 546.677799298 vcodec=mpeg4:psnr:keyint=300:vmax_b_frames=2:vb_strategy=1:b_sensitivity=10:mbd=2:trell:v4mv:last_pred=3:dia=-1:mbcmp=2 with vbitrate=512: bitrate 511.034 , PSNR 36.15 in 49.523s with vbitrate=640: bitrate 640.731 , PSNR 37.52 in 51.028s bitrate for 36.4 PSNR would be 532.566981604
but setting any other comparison function to 2 only makes things worse.
I hope you aren't basing your decisions just on PSNR. Yes I am. I know that PSNR numbers are not a perfect way of measuring visual quality, but I don't know of any other metric.
-- Software is like sex: it is better when it is free. --Linus Torvalds
L'octidi 18 ventôse, an CCXVI, Jorge Peixoto de Morais Neto a écrit :
Yes I am. I know that PSNR numbers are not a perfect way of measuring visual quality, but I don't know of any other metric.
, where the experiments seemed to indicate this was a better estimation of a subjective quality than the PSNR; but of course, they will not say that
It is possible to compute the linear correlation coefficient between the original and the encoded result, plus factors to ensure that the correlation function is actually the identity. I took the idea from <URL: http://www.cns.nyu.edu/~zwang/files/papers/quality_2c.pdf their work is lousy. Regards, -- Nicolas George
On Sat, 8 Mar 2008 01:49:25 +0100 Nicolas George <nicolas.george@normalesup.org> wrote:
L'octidi 18 ventôse, an CCXVI, Jorge Peixoto de Morais Neto a écrit :
Yes I am. I know that PSNR numbers are not a perfect way of measuring visual quality, but I don't know of any other metric.
, where the experiments seemed to indicate this was a better estimation of a subjective quality than the PSNR; but of course, they will not say that
It is possible to compute the linear correlation coefficient between the original and the encoded result, plus factors to ensure that the correlation function is actually the identity. I took the idea from <URL: http://www.cns.nyu.edu/~zwang/files/papers/quality_2c.pdf their work is lousy. What is the easiest way I can calculate such a correlation?
-- Software is like sex: it is better when it is free. --Linus Torvalds
L'octidi 18 ventôse, an CCXVI, Jorge Peixoto de Morais Neto a écrit :
What is the easiest way I can calculate such a correlation?
You can try to make this "piece of badly-written and undocumented code" work: http://www.normalesup.org/~george/comp/video_quality/video_quality-20070213.... The command-line that should work is something like: ./video_quality src1="foo.avi" src2="bar.avi" in the directory itself. Regards, -- Nicolas George
On Fri, 07 Mar 2008 08:57:57 -0800 RC <cooleyr@gmail.com> wrote:
On Thu, 6 Mar 2008 17:51:24 -0300 Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> wrote:
In my case, the mbcmp=2 option is helpful,
mbcmp=<0-2000> Sets the comparison function for the macroblock decision, *only used if mbd=0.*
I am reasonably satisfied with my current settings for encoding anime*, so now my worry is about the broken mencoder options. Specifically: 1) The man page says that mbcmp only has an effect if mbd=0. This is false. mbcmp=2 increases the PSNR for a given bitrate. I tested this on mencoder compiled from SVN on 13/02/2008 and also on mencoder compiled from SVN on 08/03/2008. 2) the option vrc_override is broken (tested on mencoder from SVN 13/02/2008). I have found other people on the internet complaining about this. 3) In my case, setting the options cmp=2 or subcmp=2 actually diminishes the PSNR. 3.1) If this means that they actually harm the video quality, then perhaps they are not adequate for anime encoding (but perhaps this only happens on a few specific videos, including mine...) 3.2) If they actually increase the video quality, but diminish PSNR (which is possible but unlikely), it should be noted in the documentation Should I file a bug report? * My current options are: #High quality encoding of anime: [anime0] lavcopts=vcodec=mpeg4:keyint=300:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell=yes:v4mv=yes:last_pred=3:predia=3:dia=3:mbcmp=2:cbp=yes:preme=2:vqcomp=0.6 #Even higher quality encoding of anime (but slower): [anime1] lavcopts=vcodec=mpeg4:keyint=300:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell=yes:v4mv=yes:last_pred=3:predia=3:dia=3:mbcmp=2:cbp=yes:preme=2:vqcomp=0.6:mv0=yes -- Software is like sex: it is better when it is free. --Linus Torvalds
On Sun, 9 Mar 2008 15:32:39 -0300 Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> wrote:
3.2) If they actually increase the video quality, but diminish PSNR (which is possible but unlikely), it should be noted in the documentation
PSNR being contrary to perception is NOT unlikely, in fact it's very common. See nr, *mask, qns, etc. Even cmp=2 is a good example, as it makes live action quite blocky, yet (usually) improves PSNR. A warning that PSNR isn't perfect would be pointless. The only real question is: What gave you the idea that it is?
On Sun, 09 Mar 2008 23:25:20 -0700 RC <cooleyr@gmail.com> wrote:
On Sun, 9 Mar 2008 15:32:39 -0300 Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> wrote:
3.2) If they actually increase the video quality, but diminish PSNR (which is possible but unlikely), it should be noted in the documentation
PSNR being contrary to perception is NOT unlikely, in fact it's very common. See nr, *mask, qns, etc. Even cmp=2 is a good example, as it makes live action quite blocky, yet (usually) improves PSNR.
A warning that PSNR isn't perfect would be pointless. The only real question is: What gave you the idea that it is? PSNR is certainly not perfect. What it tells you is that if video A has higher PSNR than video B than there is a big *chance* that video A is higher quality(1) than video B.
The documentation *does* point that qns and *mask are not good for increasing PSNR. The reason the documentation includes this information is (probably) because this information is not what we expect - we expect that better quality results in higher PSNR. If *cmp=2 also has this behavior, than it should be pointed out in the documentation, in my oppinion. 1: For me, I want the encode to preserve information, not to just "look good". Imagine a blurring filter that can make the image more compressible and therefore reduce blocking for a given bitrate. I would prefer not to use the filter, because I want to preserve information, not just to make the image "look good". For example, if there is fine print in the video, I want it to be readable. And for the low bitrates I want, I cannot have the video "look good, without blocking" and preserve fine detail at the same time, so I tolerate blocking. In fact, in my case (one who wants to preserve high detail) I think the PSNR is a good metric. By the way, something I like in the Theora codec is that it prefers to preserve fine detail than to eliminate blocking - or at least it behaved like this in the last video I tested. Since I care more about detail than about about blockiness, I like the Theora approach. -- Software is like sex: it is better when it is free. --Linus Torvalds
On Mon, 10 Mar 2008 13:34:44 -0300 Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> wrote:
By the way, something I like in the Theora codec is that it prefers to preserve fine detail than to eliminate blocking - or at least it behaved like this in the last video I tested. Since I care more about detail than about about blockiness, I like the Theora approach.
I suggest you take a closer look, because that's not what Theora/VP3 does at all. It can't preserve fine detail no matter what, it has a tendency to discolor, and it has a built-in deblocking filter (which does a poor job).
On Mon, 10 Mar 2008 11:33:22 -0700 RC <cooleyr@gmail.com> wrote:
On Mon, 10 Mar 2008 13:34:44 -0300 Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> wrote:
By the way, something I like in the Theora codec is that it prefers to preserve fine detail than to eliminate blocking - or at least it behaved like this in the last video I tested. Since I care more about detail than about about blockiness, I like the Theora approach.
I suggest you take a closer look, because that's not what Theora/VP3 does at all. It can't preserve fine detail no matter what, it has a tendency to discolor, and it has a built-in deblocking filter (which does a poor job). Thank you for this information. However I will not investigate Theora further, because I have already decided to use mencoder (which does not support Theora encoding).
My only concern now are the defects in mencoder - the brokenness of vrc_override and the errors in the documentation. The worst error in the documentation is that it says that mbcmp only has an effect if mbd=0. This is false. -- Software is like sex: it is better when it is free. --Linus Torvalds
On Mon, Mar 10, 2008 at 05:05:07PM -0300, Jorge Peixoto de Morais Neto wrote:
My only concern now are the defects in mencoder - the brokenness of vrc_override and the errors in the documentation. The worst error in the documentation is that it says that mbcmp only has an effect if mbd=0. This is false.
The man page for mbd only says: "When mbd is set to 1 or 2, the value of mbcmp is ignored when comparing macroblocks." And AFAICT this is correct. The mbcmp value is still used for motion search, but with mbd > 0 it is not used to compare the results of the motion search. The mbcmp description is wrong though. I hopefully fixed the documentation. Greetings, Reimar Döffinger
On Sun, Mar 09, 2008 at 03:32:39PM -0300, Jorge Peixoto de Morais Neto wrote:
2) the option vrc_override is broken (tested on mencoder from SVN 13/02/2008). I have found other people on the internet complaining about this.
#High quality encoding of anime: [anime0] lavcopts=vcodec=mpeg4:keyint=300:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell=yes:v4mv=yes:last_pred=3:predia=3:dia=3:mbcmp=2:cbp=yes:preme=2:vqcomp=0.6
#Even higher quality encoding of anime (but slower): [anime1] lavcopts=vcodec=mpeg4:keyint=300:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell=yes:v4mv=yes:last_pred=3:predia=3:dia=3:mbcmp=2:cbp=yes:preme=2:vqcomp=0.6:mv0=yes
You seem to be doing one-pass, vrc_override AFAICT only works on the second pass. Can you test? If you confirm, I will update the documentation. Greetings, Reimar Döffinger
On Tue, 11 Mar 2008 11:10:11 +0100 Reimar Döffinger <Reimar.Doeffinger@stud.uni-karlsruhe.de> wrote:
On Sun, Mar 09, 2008 at 03:32:39PM -0300, Jorge Peixoto de Morais Neto wrote:
2) the option vrc_override is broken (tested on mencoder from SVN 13/02/2008). I have found other people on the internet complaining about this.
#High quality encoding of anime: [anime0] lavcopts=vcodec=mpeg4:keyint=300:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell=yes:v4mv=yes:last_pred=3:predia=3:dia=3:mbcmp=2:cbp=yes:preme=2:vqcomp=0.6
#Even higher quality encoding of anime (but slower): [anime1] lavcopts=vcodec=mpeg4:keyint=300:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell=yes:v4mv=yes:last_pred=3:predia=3:dia=3:mbcmp=2:cbp=yes:preme=2:vqcomp=0.6:mv0=yes
You seem to be doing one-pass, I do 2-pass encoding. I add vpass=1:turbo in the first pass, and vpass=2 in the second pass.
vrc_override AFAICT only works on the second pass. Can you test? If you confirm, I will update the documentation. From the documentation:
vrc_override=<options> User specified quality for specific parts (ending, credits, ...) (pass 1/2). The options are <start-frame>, <end-frame>, <quality>[/<start-frame>, <end-frame>, <quality>[/...]]: quality (2-31) quantizer quality (-500-0) quality correction in % From this information, I deduce that mencoder -ovc lavc -o result.avi ../../testsource.avi -lavcopts vcodec=mpeg4:psnr:keyint=300:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:mbcmp=2:cbp:mv0:preme=2:vqcomp=0.6:vrc_override=600,1201,28:vbitrate=640 Should get me fixed quantizer 28 for frames in [600; 1201]. This is not what I get though, as can be verified by looking in the resulting psnr_*.log
* Jorge Peixoto de Morais Neto on Tuesday, March 11, 2008 at 17:36:10 -0300
On Tue, 11 Mar 2008 11:10:11 +0100 Reimar Döffinger <Reimar.Doeffinger@stud.uni-karlsruhe.de> wrote:
You seem to be doing one-pass, I do 2-pass encoding. I add vpass=1:turbo in the first pass, and vpass=2 in the second pass.
Am I wrong in understanding the docs in the sense that you don't have to remove turbo in the second pass because it is ignored then, you can just leave it there? At least the behaviour I am experiencing seems to indicate that. c -- _B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.html>
Hello, On 3/12/08, Christian Ebert <blacktrash@gmx.net> wrote:
* Jorge Peixoto de Morais Neto on Tuesday, March 11, 2008 at 17:36:10 -0300
On Tue, 11 Mar 2008 11:10:11 +0100 Reimar Döffinger <Reimar.Doeffinger@stud.uni-karlsruhe.de> wrote:
You seem to be doing one-pass, I do 2-pass encoding. I add vpass=1:turbo in the first pass, and vpass=2 in the second pass.
Am I wrong in understanding the docs in the sense that you don't have to remove turbo in the second pass because it is ignored then, you can just leave it there? At least the behaviour I am experiencing seems to indicate that.
Yes. turbo is ignored by all but the first pass. Guillaume -- A soldier will fight long and hard for a bit of colored ribbon. -- Napoleon Bonaparte
Shameless plug: You may be interesting by a look at <URL: http://www.normalesup.org/~george/comp/video_quality/ I am curious about these options:
vmax_b_frames=4 (the documentation says that 0-2 is a sane range) umv By the way, do you think that my results are meaningful in a fixed-quantizer situation? I mean, a setting that helps in my vbitrate 2-pass tests would probably also help in a fixed-quantizer situation? By the way, I would love a fixed-quality setting. I, like you, am not too strict about file size. I just want the fewest bits for a level of quality I find acceptable. Is fixed-quantizer a good substitute for fixed-quality, or did you just use due to lack of other options? I'll test it when I have time, but I want your opinion -- Software is like sex: it is better when it is free. --Linus Torvalds
On Wed, 5 Mar 2008 07:03:36 -0300 Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> wrote:
Hi. I seek high quality encoding of anime.
The test source is a 105 MB avi file with FFV1 video and no audio. The video is 1201 576x432 frames at 25fps.
time mencoder -ovc lavc -o result.avi -lavcopts vcodec=mpeg4:psnr:vbitrate=512:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:p redia=3:dia=3:vmax_b_frames=2:vb_strategy=1:b_sensitivity=10:mbcmp=2: qpel:preme=2:keyint=300:vpass=2 testsource.avi
*cmp=2 should give better quality on animation. vb_strategy=2 is better. Setting nr= will probably improve quality. qns=2 should also help, if you don't mind a major slowdown. You might also want to try border_mask.
2) When reencoding a movie with slight compression artifacts, should I use -vf pp=ac?
Absolutely not. You'll just introduce noise, which will waste bits, and make the resulting file look worse.
participants (8)
-
Christian Ebert -
Guillaume POIRIER -
Jorge Peixoto de Morais Neto -
Loren Merritt -
Nicolas George -
RC -
Reimar Döffinger -
Rich Felker