[MPlayer-users] Re: spurious blockiness when transcoding high-bitrate mpeg2 to med-bitrate mpeg4

Jason Tackaberry tack at sault.org
Sat Jul 3 19:57:15 CEST 2004


Hi Simen,

On Sat, 2004-07-03 at 18:44 +0200, Simen Thoresen wrote:
> I'm not sure if my source is not interlaced; It is /originally/ a 
> cinema-picture, distributed on laserdisk. My mpeg2-source is from a hauppage 
> PCR250 card that can perform inverse telecine while encoding. I'll try to 
> grab the movie anew with this enabled.

I'd keep your original grab and use mplayer's inverse telecine filters.
I have a feeling they would work a lot better than the hardware PVRx50
pullup.

>  > (It's sometimes hit-and-miss with B-frames.)  Use vmax_b_frames=2:
>  > vb_strategy=1.
> 
> I tried that one in between here, and am currently using it.

Make sure you use vmax_b_frames=2 rather than 1.  vmax_b_frames=1:
vb_strategy=1 uses no B-frames at all, which I reported as a bug a few
weeks ago but I'm not sure if it's been fixed (or even acknowledged).

> mv0:mbcmp=3 added.

Also cmp=3:subcmp=3

> I'll ask my PVR-card for a de-telecined grab. Reducing the framerate from 
> ~30 to ~24 should also help me get the bitrade down a bit ;-)

Again, I would use an inverse telecine filter with mencoder like -vf
pullup,softskip rather than the do it in hardware.  I don't know for
sure, but I suspect the hardware pullup isn't stateless, so that might
be problematic depending on the source.  It'd be worth experimenting, at
least.  I have a PVR350 myself, so maybe I'll compare hardware inverse
telecine with mplayer's stateless inverse telecine filters and see which
comes out on top.  However, I have done some captures from VCR and have
been quite happy with -vf pullup.

You're certainly right though, lowering the framerate will help, and as
well since there will be less jagginess compressibility will be better.
If you use a pullup filter with mencoder, specify -ofps 23.976.

Ok, one thing I just realized based on your email address's tld is that
maybe this isn't an NTSC source.  I have no experience with mplayer's
ivtc filters and 2:2 pulldown, which is what would be done with PAL;
I've only used them for 3:2 pulldown.  2:2 pulldown is much more
straightforward so I'd suspect they would handle that.  I'm curious to
hear your results.

> I would crop on the PVR card too, I think, but this movie is fullscreen.

Nevertheless, check the source carefully for black borders or half-black
pixels.

> Yup, appart from the filters;
> 
> mencoder $1 -o $2 -mc 0 \
>       -ovc lavc -lavcopts \
>       vcodec=mpeg4:vbitrate=1200:mbd=2:v4mv:keyint=132:
>       vb_strategy=1:vmax_b_frames=2:trell:mv0:mbcmp=3:vpass=$PASS \
>       -oac mp3lame -lameopts preset=192 \
>       -vf pp=md/lb/ci/li/fd
> 
> (I'll change the filters when I get my new grab)
> 
> Hm. I see you've added cmp and subcmp as well - why not precmp too?

You could specify precmp=3; I don't think it will hurt.  I haven't
observed any visible differences without specifying it, so I don't
usually, but maybe someone more familiar with lavc can give more
information.

> I'm not sure if increasing the bitrate would help much - my transcode as I 
> started this was very good as far as I could see, except for the few places 
> where it suddenly crapped out on me. It is probably my limited understanding 

Try playing back with -lavdopts debug=1 and look at the qp value for
those scenes where things get ugly.  If there are higher qp values, then
increasing bitrate will help.  If qp=2, then you're right, high bitrate
will make no visible difference.  In that case, you could try using
*cmp=10 and see if things look better for you.

> Thank you too for your help. I've played around a fair bit with mplayer and 
> mencoder, but this is the first time I try to make high-quality transcodes.

It can be fun and enlightening, and also terribly time consuming, to
test all these lavc options and mplayer filters. :)

Cheers,
Jason.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20040703/45215843/attachment.pgp>


More information about the MPlayer-users mailing list