[MEncoder-users] 2pass: auto-calculation of bitrate?

Ilya Zakharevich nospam-abuse at ilyaz.org
Tue Nov 25 02:53:18 CET 2008


[A complimentary Cc of this posting was NOT [per weedlist] sent to
James Hastings-Trew 
<mencoder-users at mplayerhq.hu>], who wrote in article <4928DF92.3050701 at shaw.ca>:
> >> A better approach than trying to find some arbitrary average value 
> >> across a number of unrelated movies which all have different compression 
> >> needs is to "sample" each movie and compress then with a constant 
> >> quality factor.
> >   ^^^^^^^^^^^^^^

> > What's this?   Quantizer?

> Did this just drop out of a way-back machine? This is a fragment of a 
> pretty old discussion. :)

No, it is just that GMANE retention is longer than the characteristic
time of myself checking the newsgroup.  ;-)

> If I recall the discussion at the time, someone was proposing some kind 
> of "rule of thumb" to guess at a 1 pass bitrate for a given movie based 
> on it's genre.

No.  The target was to give a better guess for a 2-pass bitrate than
using a constant.

> I gave two examples of genre movies that would invalidate 
> such an approach. Then I suggested a different approach - sampling a 
> portion of the movie and guessing at a good target bitrate based on that.

Correct.  But still, what is "quality factor" in context of mencoder?

> > Why not do something much more direct?  Like a two-pass option - but
> > not with "target bitrate", but with "target average quantizer"
> > (whatever meaning is appropriate)?  Or maybe it is possible now?

> I'm not sure what the point of that would be - you are worrying about 
> bitrate because you care about file size or the bandwidth of the video 
> stream - for whatever technical reasons you need to cram the movie into 
> a given space, or at a given rate.

But *I* do not worry about the rate at all.  All I want is to get a
comparable quality across a range of input videos.  And I want an
adaptive bitrate as well.

Is it going to be the same as having a constant quantizer, or maybe
mencoder can guess better than this (given a result of the 1st-pass)?

> You use a constant quality factor if you care about visual quality,
> and size and bandwidth are not issues.

Size is not an issue AS FAR AS reducing size 30% won't preserve the
same visual quality.  The idea is to guess at which average bitrate
the saturation starts...

> > All true, but what is your point?  Do you think that using
> > bitrate=800000 is going to be better than the "averaging approach"?

> Mmm.. no, I suggested a sub-sample approach, which has worked out very 
> well for me, in practice.

When I design what kind of average user intelligence to expect, I try
to image how my grandmother (if she were available) would perform the
task.

> It takes about 2 minutes to take several sub-samples of the movie at
> regular intervals and derive a target bitrate based on the results,
> followed by a one-pass encode that gives very good results, fairly
> close to the target file size, in a reasonable amount of time.

I do not doubt that a video adept with a lot of spare time and a good
grasp of technical matters can reach such level of expertise.  Now
think about unwashed masses of my grandmothers ;-).

Could not an automatic scan of the log of the 1st-pass achieve
something at least 30% as good as your expert analysis of the actual
output images?  [I have no idea WHAT is in the log; is it documented anywhere?]

> A second pass would be nice, but we all don't have 8-core Xeon
> workstations. ;)

Why care about speed?  I'm encoding on Athlon/850MHz; in a week, a
batch is finished ;-).

Thanks,
Ilya




More information about the MEncoder-users mailing list