Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-2 Encoding
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st August 2005, 16:00   #61  |  Link
hank315
HCenc author
 
Join Date: Nov 2003
Location: Netherlands
Posts: 570
Because I used the Basic version of CCE there's not much to tweak.
Matrix used in CCE Basic:
8 16 19 22 26 27 29 34
16 16 22 24 27 29 34 37
19 22 26 27 29 34 34 38
22 22 26 27 29 34 37 40
22 26 27 29 32 35 40 48
26 27 29 32 35 40 48 58
26 27 29 34 38 46 56 69
27 29 35 38 46 56 69 83

16 17 18 19 20 21 22 23
17 18 19 20 21 22 23 24
18 19 20 21 22 23 24 25
19 20 21 22 23 24 26 27
20 21 22 23 25 26 27 28
21 22 23 24 26 27 28 30
22 23 24 26 27 28 30 31
23 24 25 27 28 30 31 33

I also tried dc precision 10, values were a bit lower.

Update for Quenc:
version 0.59
VBR, high quality
extreme & slow, trellis
GOP 15/2, progressive
same matrix as CCE Basic
file size: 28210
PSNR: 46.94
SSIM2: 83.00

@Sagittaire
For a fair comparison I think that it also should be a requirement that the clips are MPEG compliant.
I checked some of them, they are all OK except the Mencoder clip...
hank315 is offline   Reply With Quote
Old 22nd August 2005, 19:01   #62  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
@hank,

i4004, asked me to ask you the following

In what way is the mencoder clip not MPEG compliant? Did Sagittaire forgot to use
Code:
vrc_buf_size=<value>
buffer size in kbit (pass 1/2). For MPEG1/2 this also sets the vbv buffer size, use 327 for VCD, 917 for SVCD and 1835 for DVD.
Wilbert is offline   Reply With Quote
Old 22nd August 2005, 20:53   #63  |  Link
hank315
HCenc author
 
Join Date: Nov 2003
Location: Netherlands
Posts: 570
@Wilbert
No, it's something else.
I just discovered it by accident because I introduced the same bug with HC015 (will be solved in HC016)
It can cause severe blocking on some (very strict) HW players like Pioneer, Philips and Koss.
It's about motion vector length which is restricted for Main level.
In fact it was mean who pointed me to this very well hidden MV restriction.
The vertical motion vectors should be limited so they can be 'folded' in f_codes <= 5.
In about 15% of the frames Mencoder also uses values of 6 and 7 for f_code[0][1] and f_code[1][1].

For this contest it's not that important, values for Mencoder will be a bit lower if ME vectors are restricted, the libavcodec encoders just can't be beaten on metrics
Because the Quenc encoding was OK maybe it's just caused because Sagittaire used a version of Mencoder with an older libavcodec.
hank315 is offline   Reply With Quote
Old 22nd August 2005, 21:25   #64  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
motion vector range ... perhabs. I think that for MPEG2 compliant stream max vector must be 128 ... ???
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 22nd August 2005, 21:42   #65  |  Link
hank315
HCenc author
 
Join Date: Nov 2003
Location: Netherlands
Posts: 570
For Main level, ISO 13818-2, table 7-8 and E-8:
horizontal range: -1024 : 1023.5 (f_code = 8)
vertical range: -128 : 127.5 (f_code = 5)
hank315 is offline   Reply With Quote
Old 22nd August 2005, 23:24   #66  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Thanks for the explanation!
Wilbert is offline   Reply With Quote
Old 23rd August 2005, 15:15   #67  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
Update with new mencoder sample:

Mencoder with Compliant Vector Range Limitation

Special Mencoder but I don't know if it's really compliant

Mencoder-Optimum.m2v is the very best for metric and by far:
PSNR = 47.25 dB
SSIM = 83.51

@ hank315

You can check the MPEG compliance for these mencoder sample ... ???
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 23rd August 2005, 21:32   #68  |  Link
hank315
HCenc author
 
Join Date: Nov 2003
Location: Netherlands
Posts: 570
@Sagittaire
Both clips seem OK.
What did you change in your parameters?
hank315 is offline   Reply With Quote
Old 23rd August 2005, 22:38   #69  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
Quote:
Originally Posted by hank315
@Sagittaire
Both clips seem OK.
What did you change in your parameters?
me_range=128 in mencoder CLI

Here new encoding with HVS optimisation
PSNR : 47.19 dB
SSIM : 83.77 ....

I think that will be very hard for the other MPEG2 coder to obtain better metrics ... lol
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 25th August 2005, 00:04   #70  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
I try to make the best possible quality with CCE (the most popular MPEG2 encoder for DVD9 -> DVD5 backup) but quality for metric (for my eyes too) is very low : CCE encoding 4 pass

It's very strange ... nobody can do better ... ???
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 25th August 2005, 01:53   #71  |  Link
Audionut
Registered User
 
Join Date: Nov 2003
Posts: 1,281
When try'd with CCE, I got SSIM, something in the order of 77 - 78.
The quality of the clip, was also not at the standard of the other encoders.

Out of intrest. What FPS do you get with mencoder.

And where can I find the command line options.
I have searched as best as I can, and cannot find any sort of list.

Thanks.
Audionut is offline   Reply With Quote
Old 25th August 2005, 20:47   #72  |  Link
hellfred
FFmpeg fan
 
Join Date: Dec 2003
Location: Germany
Posts: 427
Quote:
Originally Posted by Audionut
When try'd with CCE, I got SSIM, something in the order of 77 - 78.
The quality of the clip, was also not at the standard of the other encoders.

Out of intrest. What FPS do you get with mencoder.

And where can I find the command line options.
I have searched as best as I can, and cannot find any sort of list.

Thanks.
mplayer/mencoder manpage should tell you all possible options. It is available as e.g. HTML here .

Hellfred

EDIT: In the DOCS/tech directory there are some nice readings getting you started, too. If you already have the source, have a look there for the encoding-guid.txt. Or read it online

Last edited by hellfred; 25th August 2005 at 20:55.
hellfred is offline   Reply With Quote
Old 27th August 2005, 00:28   #73  |  Link
ronnylov
Registered User
 
Join Date: Feb 2002
Location: Borås, Sweden
Posts: 492
I have made some new testing with Mainconcept Encoder.
First I changed to VLC table 0 instead of VLC table 1 in the advanced settings tree. Does this still make it DVD-compliant?

I got a filesize of 28058 KB which would correspond to 1790 kbit/s

OPSNR: 45.02
SSIM 2: 80.25

Then I tried linear quantization scale and SSIM2 improved to 80.37 and the filesize decreased to 27979 KB. So I upped the bitrate setting to 1816 kbit/s and got following new improved results for Mainconcept Encoder:

File size: 28902503 bytes (28226 KB)
Bit rate: 1800 kbit/s
OPSNR: 45.21
SSIM2: 80.54
__________________
Ronny
ronnylov is offline   Reply With Quote
Old 27th August 2005, 14:32   #74  |  Link
danpos
BDVD Team
 
danpos's Avatar
 
Join Date: Dec 2004
Location: Rio de Janeiro - RJ/Brasil
Posts: 306
Quote:
Originally Posted by Sagittaire
me_range=128 in mencoder CLI

Here new encoding with HVS optimisation
PSNR : 47.19 dB
SSIM : 83.77 ....

I think that will be very hard for the other MPEG2 coder to obtain better metrics ... lol
Hi Sagittaire! I've downloaded the .m2v file encoded with mencoder using HSV optimisation and I've to say OHHHH!! The visual quality is very, very good. I would like to know how to do this optimisation with mencoder (I'm not a mencoder user for now ).

TIA,
danpos is offline   Reply With Quote
Old 27th August 2005, 15:56   #75  |  Link
hellfred
FFmpeg fan
 
Join Date: Dec 2003
Location: Germany
Posts: 427
Quote:
Originally Posted by danpos
Hi Sagittaire! I've downloaded the .m2v file encoded with mencoder using HSV optimisation and I've to say OHHHH!! The visual quality is very, very good. I would like to know how to do this optimisation with mencoder (I'm not a mencoder user for now ).

TIA,
Mplayers/Mencoders Mangage gives you an overview over what parameters can be set. A encoding-howto is available in the DOCS/tech/encoding-guide.txt in the mplayer source.
Online manual in several languages is available here.
The CSV-repository can be browsed, too, so reading the encoding-guide online is possible, too.

There are lots of GUI-frontends to mencoder, and other encoding tools that use libavcodec, like QuEnc.

Hellfred
hellfred is offline   Reply With Quote
Old 27th August 2005, 17:58   #76  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
Little demo with mencoder:

Serenity Trailer
Video:
720*576 16/9 PAL format 2.35
Real image mod8 720*432 with mod8 720*72 blackborders
MPEG2 MP@ML 3000 Kbps highest quality
Audio:
DD 2.0 16bits 48Khz
AC3 224 Kbps

The trailer is very hard but detail level is incredible. Quality is by far higher than the usual average quality for trailers and with only 3 Mbps.

Mencoder use Libavcodec binaries like QuEnc but advanced setting available are very better for mencoder. The problem is that Mencoder is really buggy for the MPEG2 : problem with quant (the real quant is scalling by x2 and only q = 2, 4, 6, 8, 10 ... are available), custom quant too ... conclusion : it's very hard to use Mencoder in reals conditions. QuEnc is very better for that.


3 pass Highest quality - Very Slow

Code:
mencoder.exe HDTV.avs -o MPEG2-HQ1.m2v -ovc lavc -lavcopts vcodec=mpeg2video:vpass=1:vqmin=1:vqscale=2:vrc_maxrate=9800:vrc_buf_size=1835:keyint=15:vqcomp=0.9:vmax_b_frames=2:vb_qfactor=1.0:vb_qoffset=0.0:vi_qfactor=1.0:me_range=128:preme=2:dia=6:predia=6:mbd=2:mbcmp=262:precmp=262:cmp=256:subcmp=262:mv0:trell:cbp:qprd:dc=8:psnr:aspect=16/9:inter_matrix=20,20,20,20,21,22,23,24,20,20,20,20,21,22,24,25,20,20,20,21,22,24,26,28,20,20,21,22,24,27,29,32,21,21,22,24,28,31,34,39,22,22,24,27,31,37,42,49,23,24,26,29,34,42,52,60,24,25,28,32,39,49,60,80:intra_matrix=8,16,16,16,17,17,18,19,16,16,16,16,17,18,19,20,16,16,16,17,18,19,20,22,16,16,17,18,19,21,23,26,17,17,18,19,21,24,27,31,17,18,19,21,24,28,33,40,18,19,20,23,27,33,42,51,19,20,22,26,31,40,51,64 -of rawvideo -ffourcc MPG2

mencoder.exe HDTV.avs -o MPEG2-HQ2.m2v -ovc lavc -lavcopts vcodec=mpeg2video:vpass=3:vqmin=1:vbitrate=3000:vrc_maxrate=9800:vrc_buf_size=1835:keyint=15:vqcomp=0.9:vmax_b_frames=2:vb_qfactor=1.0:vb_qoffset=0.0:vi_qfactor=1.0:me_range=128:preme=2:dia=6:predia=6:mbd=2:mbcmp=262:precmp=262:cmp=256:subcmp=262:mv0:trell:cbp:qprd:dc=8:psnr:aspect=16/9:inter_matrix=20,20,20,20,21,22,23,24,20,20,20,20,21,22,24,25,20,20,20,21,22,24,26,28,20,20,21,22,24,27,29,32,21,21,22,24,28,31,34,39,22,22,24,27,31,37,42,49,23,24,26,29,34,42,52,60,24,25,28,32,39,49,60,80:intra_matrix=8,16,16,16,17,17,18,19,16,16,16,16,17,18,19,20,16,16,16,17,18,19,20,22,16,16,17,18,19,21,23,26,17,17,18,19,21,24,27,31,17,18,19,21,24,28,33,40,18,19,20,23,27,33,42,51,19,20,22,26,31,40,51,64 -of rawvideo -ffourcc MPG2

mencoder.exe HDTV.avs -o MPEG2-HQ3.m2v -ovc lavc -lavcopts vcodec=mpeg2video:vpass=3:vqmin=1:vbitrate=3000:vrc_maxrate=9800:vrc_buf_size=1835:keyint=15:vqcomp=0.9:vmax_b_frames=2:vb_qfactor=1.0:vb_qoffset=0.0:vi_qfactor=1.0:me_range=128:preme=2:dia=6:predia=6:mbd=2:mbcmp=262:precmp=262:cmp=256:subcmp=262:mv0:trell:cbp:qprd:dc=8:psnr:aspect=16/9:inter_matrix=20,20,20,20,21,22,23,24,20,20,20,20,21,22,24,25,20,20,20,21,22,24,26,28,20,20,21,22,24,27,29,32,21,21,22,24,28,31,34,39,22,22,24,27,31,37,42,49,23,24,26,29,34,42,52,60,24,25,28,32,39,49,60,80:intra_matrix=8,16,16,16,17,17,18,19,16,16,16,16,17,18,19,20,16,16,16,17,18,19,20,22,16,16,17,18,19,21,23,26,17,17,18,19,21,24,27,31,17,18,19,21,24,28,33,40,18,19,20,23,27,33,42,51,19,20,22,26,31,40,51,64:lumi_mask=0.05:dark_mask=0.3:tcplx_mask=0.1:scplx_mask=0.1:naq -of rawvideo -ffourcc MPG2
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9

Last edited by Sagittaire; 27th August 2005 at 18:17.
Sagittaire is offline   Reply With Quote
Old 27th August 2005, 18:09   #77  |  Link
Pookie
Registered User
 
Join Date: Apr 2005
Posts: 1,339
Sagittaire: VERY nice encoding job! Would you please post the specific command line parameters that you used in mencoder ? TIA.
Pookie is offline   Reply With Quote
Old 27th August 2005, 18:18   #78  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
3 pass High quality - Good Speed

Code:
mencoder.exe HDTV.avs -o MPEG2-HQ1.m2v -ovc lavc -lavcopts vcodec=mpeg2video:vpass=1:turbo:vqmin=1:vqscale=2:vrc_maxrate=9800:vrc_buf_size=1835:keyint=15:vqcomp=0.9:vmax_b_frames=2:vb_qfactor=1.0:vb_qoffset=0.0:vi_qfactor=1.0:me_range=128:preme=2:dia=-6:predia=-6:mbd=2:mbcmp=256:precmp=256:cmp=256:subcmp=256:mv0:trell:cbp:qprd:dc=8:psnr:aspect=16/9:inter_matrix=20,20,20,20,21,22,23,24,20,20,20,20,21,22,24,25,20,20,20,21,22,24,26,28,20,20,21,22,24,27,29,32,21,21,22,24,28,31,34,39,22,22,24,27,31,37,42,49,23,24,26,29,34,42,52,60,24,25,28,32,39,49,60,80:intra_matrix=8,16,16,16,17,17,18,19,16,16,16,16,17,18,19,20,16,16,16,17,18,19,20,22,16,16,17,18,19,21,23,26,17,17,18,19,21,24,27,31,17,18,19,21,24,28,33,40,18,19,20,23,27,33,42,51,19,20,22,26,31,40,51,64 -of rawvideo -ffourcc MPG2

mencoder.exe HDTV.avs -o MPEG2-HQ2.m2v -ovc lavc -lavcopts vcodec=mpeg2video:vpass=3:vqmin=1:vbitrate=3000:vrc_maxrate=9800:vrc_buf_size=1835:keyint=15:vqcomp=0.9:vmax_b_frames=2:vb_qfactor=1.0:vb_qoffset=0.0:vi_qfactor=1.0:me_range=128:preme=-6:dia=-6:predia=2:mbd=2:mbcmp=256:precmp=256:cmp=256:subcmp=256:mv0:trell:cbp:qprd:dc=8:psnr:aspect=16/9:inter_matrix=20,20,20,20,21,22,23,24,20,20,20,20,21,22,24,25,20,20,20,21,22,24,26,28,20,20,21,22,24,27,29,32,21,21,22,24,28,31,34,39,22,22,24,27,31,37,42,49,23,24,26,29,34,42,52,60,24,25,28,32,39,49,60,80:intra_matrix=8,16,16,16,17,17,18,19,16,16,16,16,17,18,19,20,16,16,16,17,18,19,20,22,16,16,17,18,19,21,23,26,17,17,18,19,21,24,27,31,17,18,19,21,24,28,33,40,18,19,20,23,27,33,42,51,19,20,22,26,31,40,51,64 -of rawvideo -ffourcc MPG2

mencoder.exe HDTV.avs -o MPEG2-HQ3.m2v -ovc lavc -lavcopts vcodec=mpeg2video:vpass=3:vqmin=1:vbitrate=3000:vrc_maxrate=9800:vrc_buf_size=1835:keyint=15:vqcomp=0.9:vmax_b_frames=2:vb_qfactor=1.0:vb_qoffset=0.0:vi_qfactor=1.0:me_range=128:preme=2:dia=-6:predia=-6:mbd=2:mbcmp=256:precmp=256:cmp=256:subcmp=256:mv0:trell:cbp:qprd:dc=8:psnr:aspect=16/9:inter_matrix=20,20,20,20,21,22,23,24,20,20,20,20,21,22,24,25,20,20,20,21,22,24,26,28,20,20,21,22,24,27,29,32,21,21,22,24,28,31,34,39,22,22,24,27,31,37,42,49,23,24,26,29,34,42,52,60,24,25,28,32,39,49,60,80:intra_matrix=8,16,16,16,17,17,18,19,16,16,16,16,17,18,19,20,16,16,16,17,18,19,20,22,16,16,17,18,19,21,23,26,17,17,18,19,21,24,27,31,17,18,19,21,24,28,33,40,18,19,20,23,27,33,42,51,19,20,22,26,31,40,51,64:lumi_mask=0.05:dark_mask=0.3:tcplx_mask=0.1:scplx_mask=0.1:naq -of rawvideo -ffourcc MPG2
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9

Last edited by Sagittaire; 27th August 2005 at 18:36.
Sagittaire is offline   Reply With Quote
Old 27th August 2005, 19:45   #79  |  Link
danpos
BDVD Team
 
danpos's Avatar
 
Join Date: Dec 2004
Location: Rio de Janeiro - RJ/Brasil
Posts: 306
@Hellfred

Thanks mate !!

@Sagittaire

Gotcha!!

Cya!
danpos is offline   Reply With Quote
Old 30th August 2005, 23:21   #80  |  Link
hank315
HCenc author
 
Join Date: Nov 2003
Location: Netherlands
Posts: 570
Well, I never tried Mencoder but Sagittaire is right, it's very buggy for MPEG2
I want to use it because I had an idea to improve the metric values.
Because I couldn't get Mencoder to work properly I just took the last encode of Sagittaire with HVS optimization and did a "transcode" on it to optimize it even more.

Original file size: 28249 KB
bitrate: 1800 Kb/s
PSNR: 47.19
SSIM2: 83.77

Optimized file size: 27222 KB
bitrate: 1735 Kb/s
PSNR: 47.19
SSIM2: 83.77
hank315 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.