[MPlayer-users] RFC: docs update for "how to create a high quality DVD rip"

Jason Tackaberry tack at sault.org
Mon Jun 7 19:48:29 CEST 2004


On Mon, 2004-06-07 at 12:08 -0500, Wayde Milas wrote:
> On Sun, 2004-06-06 at 23:20, Jason Tackaberry wrote:
> Ive been following this thread with ALOT of interest because this is
> exactly what I use mplayer/mencoder for. I have a large (multi terabyte)
> server that feeds video anywhere I want in my home.

Multi-TB?  I'd be curious to hear how you have that set up.

> The idea is to have near the same quality as the original, (at least to
> the naked eye) but compress the stream as small as possible. Ie, high
> qulity/high bit encoding with the purpose to still have a smaller than
> mpeg2 stream.

You're the exact target audience for my encoding guide.
 
> What we REALLY need is vorbis to compress greated than stereo files.
> From what I understand its theoreticly possible to do this, but no tools
> exist to do it/play them correctly. Then we could have our cake and eat
> it too.

MPlayer would have to convert this 5+ channel Vorbis into AC3 so that I
can still get my pass-through, though.  But yeah, that would be pretty
cool. :)

> This is a new one for me. Well, not new, but the whole noise thing
> scares me. From what I understand, noise will take out some of teh
> random noisy garbage thats not supposed to be there on flat surfaces,
> ect. However, It also removes detail on stuff that IS supposed to be
> there.

This depends entirely on the values you give the denoise filter.  With
hqdn3d=2:1:2 I haven't been able to see any difference except in bitrate
on every video I've tested.  With 4:3:6, the defaults, on occasion I've
seen it do unwanted things to the video.

> How safe is this to actually use on high quality archival streams?

I'd say light values are perfectly safe.  Of course, your mileage may
vary.  But my experience is that at least a little bit of denoise helps
much more than it hurts.

> Also, when you go to play the file, is it a simple means to add the
> noise back in? If so, is teh noise added back in exactly the same as it
> was taken out, thus resulting in the same stream, but causing more cpu
> processing time, or is the stream "almost" like the original.

I mentioned this in the guide (did you read it?  Any comments?).  You
can add the noise back in with the noise filter.  A small amount of
temporal noise makes night-and-day difference when there are blocky
artifacts in the AVI.  I use:

   mplayer movie.avi -vf spp,noise=9ah:5ah -autoq 3

You might want to use -autoq 2 if you have a slower CPU.  -autoq
controls the quality level of the spp filter, which does help visibly by
smoothing out the blockiness.  With these two filters and a high bitrate
rip, I frequently have a hard time telling apart the MPEG4 and the DVD.

> Let me qualify that. I know this is lossy. By original I mean an encoded
> stream that has no denoise filter applied when encoded.

With no denoise filter you may end up having lower quality because lavc
will use a lower quantizer on frames that don't need it in order to
preserve the noise in the original source.  Filtering some of the noise
out means that lavc can use lower quantizers in places that matter.

> The question I think is at what point (maybe a lose rule of thumb.. of
> course you need to play with individual movies to see the exact place)
> does it make sense to scale the stream down to create a stream that
> looks better X bitrate.

When your have no file size constraints, then no, it doesn't make sense.
But when you do, then scaling down may likely be the right thing to do.

As Rich pointed out, the artifacting caused by using higher quantizers
is much worse than the artifacts caused by scaling up a video (it will
be blurrier).  When you have a size constraint, you need to find the
right balance between scale and quantizer.  I'm sure there are some
strategies to do this, but aside from trial and error I don't really
know them.  (Of course, it'd not be difficult to write a script to try
multiple scales at fixed bitrates and capture certain scenes, then
compare the PSNR, and pull out still frames for A/B comparisons.  But
there may be smarter approaches.)

Anyway, all that is unnecessary when you decide to trade bits for
maximum quality.  But there's a place for scaling.

> I guess what I'm asking here is that if I have stream at X by Y at lets
> say 960. Would it look better at X by Y or X/2 by Y/2? I know this is a
> bad generalization, but I'm looking for a loose set of parameters to
> know at what rate a good, modern, progressive 24fps widescreen dvd
> encoded movie should be encoded at at full resulution, and at what
> bitrate I should start thinking of scaling the resolution down.

Well, scaling the resolution down by _half_ is too much.  But scaling
the resolution down say 20% will probably look appreciably better if
lavc starts using higher quantizers at 960kbit.

I think around 1400kbit you might get better quality with scaling down.
One easy way to find out is to play back the movie with -lavdopts
debug=1 and have a look at what frame quantizers are being used.  If the
quantizers are fairly low then scaling won't help, otherwise it will.

Anyway, all this is according to my intuition.  I've never needed to do
this in practice.  Rich will be able to offer better advice if this is
what you want to do.

> Something else for high quality encoding. the cmp functions (default is
> 1 I think) plain suck. Well, they arent cpu intensive but with some more
> processsing time you yield dramaticly higher PSNR values on clean signal
> originals.

I haven't played with the cmp functions much.  I'd be interested to hear
others' results.  If general consensus is that cmp=0 is much lower
quality, then that should be mentioned in the guide.
 
> 3 is a bit overkill but can be slightly better than 2 in my opinion. 2
> is a diffinate must.

After Michael's changes last night, it's quite tempting to recommend
cmp=10. :)  Of course that needs much more testing.

> On animated/cartoon stuff 7 seems to work well also. 2 nad 3 yield
> higher bsnr values (by ALOT) on jsut about everything ive tried them on.
> B&W dont get a smaller psnr boost.

At higher bitrates I've discovered that PSNR doesn't really mean much.
Too often I've seen video with a 1-2dB lower PSNR look better.  This was
shown even more with the new NSSE cmp function, where the PSNR is about
1dB less than the default cmp, but it looks _drastically_ better to my
eye.

> Be prepared for longer encoding times.

Ehh, cycles are cheap. :)

Cheers,
Jason.




More information about the MPlayer-users mailing list