PDA

View Full Version : [Challenge Low Bitrate] Best MPEG2 Encoder for objectives tests


Sagittaire
13th August 2005, 16:40
~ Movie Metric Benchmark Challenge ~

You think that your MPEG2 coder is the best : prove that ... !!?


A - Introduction

The purpose of this challenge is to determine which is the best codec for the metrics and only for the metrics : this test will not speak about subjective visual quality. If you want subjective visual comparison download sample and compare yourself ...



B - Rules

Rule 1 : Source

You must use this source for the test : Harry Potter II trailer, 720*576 MPEG2 MP@ML 4.5 Mbps
HPII Part1 winrar (http://multimediacom.free.fr/Download/HPII.part1.rar), HPII Part2 winrar (http://multimediacom.free.fr/Download/HPII.part2.rar), HPII Part3 winrar (http://multimediacom.free.fr/Download/HPII.part3.rar), HPII Part4 winrar (http://multimediacom.free.fr/Download/HPII.part4.rar) & HPII Part5 winrar (http://multimediacom.free.fr/Download/HPII.part5.rar)


Rule 2 : Pre-process and encoding

You must use DGindex with 32-bit SSE/MMX iDCT algorithm for .d2v project and DGDecode.dll for MPEG2 decoding in avisynth scipt. You must use MPEG2 with DVD standard MPEG2 MP@ML Pal DAR 4/3 PAR 12:11 profil. You must use this avisynth script for make encoding:

source=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\azerty.d2v",idct=2)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)
Return(source)



Rule 3 : Bitrate

You must use these bitrate/size for encoding:

The first round use is very low bitrate for MPEG2 : Average bitrate is 1800 Kbps for mini-DVD profil encoding.
Mini-DVD: Average 1800 Kbps for Video Elementary Stream or 28125 Ko for m2v file.


Rule 4 : Metric Tests

SSIM (YV12): IMO the best metric. it uses some HVS properties but not all ...
PDF description for VSSIM (http://www.cns.nyu.edu/~zwang/files/papers/vssim.pdf)

Overall PSNR (YV12): Very good metric test, particullary for Rate Control Quality test ...
MSE = Sum t = 1 -> NFrame Sum x = 1 -> width Sum y = 1 -> height (F'(x,y,t)-F(x,y,t))² / (NFrame*width*height)
Overall PSNR = 10 * Log ( 255² / MSE)

Average PSNR (YV12):The worse metric test but Frame PSNR graph is very good to compare RC strategy ...
MSE = Sum x = 1 -> width Sum y = 1 -> height (F'(x,y,t)-F(x,y,t))² / (width*height)
Average PSNR = Sum t = 1 -> NFrame 10 * Log ( 255² / MSE) / Nframe


SSIM vs PSNR

"For a given reference video and a given compressed video, it is meant to compute a quality metric, based on perceived visual distortion. Unlike the well-known PSNR measure, it's not purely mathematical, and should correlate much better with human vision."

"A higher MSE (and so lower PSNR) should mean that the compressed clip is a worse image but MSE and PSNR are flawed in this respect as numerous tests have shown. However with SSIM, according to tests carried out on the VQEG dataset, a higher Q (SSIM value) has a much better relation to the visual quality of the compressed clip. Despite this, bear in mind the SSIM metric still isn't perfect."

Here (http://multimediacom.free.fr/Download/SSIM.rar) last AviSynth plugin for VSSIM in YV12


Average PSNR vs Overall PSNR

It's easy to increase artificially Average PSNR with Rate Control tweak. In certain case CBR (0% for variability) will be better than real VBR (100% for variability or constant quant). It's generaly not possible with Overall PSNR. Overall PSNR is very good to test Rate Control quality. If difference between Average PSNR and Overall PSNR is very high, "local quality difference" (difference between Pframe or Bframe for exemple) or "scene quality difference" (difference between low motion and high motion for exemple) will be too high and Rate Control for this codec not very good.

Here (http://multimediacom.free.fr/Download/CompareYV12.zip) last AviSynth plugin for Overall PSNR in YV12


Open your avs metric script with VirtualDub. Select file > preview input for run the test. Select file > close video file for obtain final result in log metric files. You must use these AviSynth type script for metric test:

# --> Video Opening <--

source=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\azerty.d2v",idct=2)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)

video=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\qwaerty.d2v",idct=2)

# --> PSNR analysis <--
compareYV12(video,source,"YUV","PSNR-MPEG2.log")



# --> Video Opening <--

source=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\azerty.d2v",idct=2)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)

video=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\qwaerty.d2v",idct=2)

# --> SSIM analysis <--
SSIM(source,video,"results.csv","SSIM-MPEG2.log",lumimask=2)



C - Results

At this time here the best result ... but done better if you can ... :devil:

|-----------------|---------|---------|---------|---------|
| Codec | Bitrate | Size | OPSNR | SSIM 2 |
|-----------------|---------|---------|---------|---------|
| TMPGEnc | 1803 | 28130 | 45.26 | 80.67 |
| CCE | 1800 | 28179 | 45.83 | 78.76 |
| Canopus | 1793 | 27956 | 46.49 | 82.49 |
| Mainconcept | 1800 | 28200 | 45.21 | 80.54 |
| HC | 1801 | 28252 | 46.24 | 81.53 |
| QuEnc (lavc) | 1800 | 28210 | 46.94 | 83.00 |
| mencoder (lavc) | 1801 | 28207 | 47.47 | 84.79 |
| AQMatEnc (lavc) | 1800 | 28244 | 46.72 | 82.97 |
|-----------------|---------|---------|---------|---------|
SSIM 0: Lumimask Off
SSIM 2: Lumimask On (One2Tech Patch)



MPEG2 MP@ML : TMPGEnc encoding by Sagittaire
File: Not available

MPEG2 MP@ML : QEnc encoding by hank315
File: Not available

MPEG2 MP@ML : Mencoder encoding by Sagittaire
File: Not available

MPEG2 MP@ML : FFDShow encoding by Sagittaire
File: Not available

MPEG2 MP@ML : HC015 encoding by Audionut
File: Not available

MPEG2 MP@ML : AutoQMatEnc encoding by SAPSTAR
File: Not available

MPEG2 MP@ML : Mainconcept encoding by ronnylov
File: Not available

MPEG2 MP@ML : Canopus Procoder encoding by ronnylov
File: Not available


D - Conclusion

At this time for this trailer

The best is Mencoder encoding by Sagittaire

IF YOU DON'T AGREE WITH THAT, TRY TO MAKE BETTER WITH YOUR FAVORITE ENCODER ... !!!


Annexe - Update

11.03.06 : Sagittaire with Mencoder
04.09.05 : ronnylov with ProCoder
27.08.05 : Sagittaire with Mencoder
27.08.05 : Ronnylov with Mainconcept
18.08.05 : SAPSTAR with AutoQMatEnc
16.08.05 : Ronnylov with Mainconcept and ProCoder
14.08.05 : Sagittaire with QEnc, Mencoder and FFDShow
14.08.05 : hank315 with HC015

IgorC
13th August 2005, 22:43
There is TMPGEnc 2.521.63.181 version in offcicial site. it shouldn't be a big difference.

Fishman0919
14th August 2005, 00:17
What about AutoQMatEnc.... :)

Sagittaire
14th August 2005, 00:31
There is TMPGEnc 2.521.63.181 version in offcicial site. it shouldn't be a big difference.

I don't know ... ???
Make encoding and post your best result if you want ... ;)
My encoding is just the first for start challenge ... :cool:


What about AutoQMatEnc....

It's a challenge ... if you think that AutoQMatEnc can be better make encoding and post it ... ;)

hank315
14th August 2005, 01:07
|--------------|---------|---------|---------|---------|
| Codec | Bitrate | Size | OPSNR | SSIM 2 |
|--------------|---------|---------|---------|---------|
| TMPGEnc | 1787 | 27934 | 45.45 | 80.81 |
| CCE | .... | ..... | ..... | ..... |
| Canopus | .... | ..... | ..... | ..... |
| QEnc | .... | ..... | ..... | ..... |
| HC015 | 1793 | 28117 | 46.50 | ..... |
|--------------|---------|---------|---------|---------|Couldn't get the SSIM2 value, got an error running the script.

Settings used:
- Constant Quant at 6.55
- best profile

Other settings same as in the TMPG file (matrix, dc prec. etc.)

Sagittaire
14th August 2005, 01:19
try this new script:
# --> Video Opening <--

source=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\azerty.d2v",idct=2)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)
source=trim(source,0,3210)

video=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\qwaerty.d2v",idct=2)
video=trim(video,0,3210)

# --> SSIM analysis <--
SSIM(source,video,"results.csv","D:\Mes dossiers\B.A\Harry Potter\SSIM-MPEG2.log",lumimask=2)

#return video

http://multimediacom.free.fr/Download/CompareYV12.zip
http://multimediacom.free.fr/Download/SSIM-0.24.rar
length problem -> trim last black frame (it's not important with SSIM because lumimasking ponderation)
log problem -> complete directory for log files


and if possible post your m2v file ...

SAPSTAR
14th August 2005, 01:38
Interesting concept but :
- Why only Harry Potter II ?!? Some encoders are good at interlaced movies others no....Some are good at low bitrates others no.....and so on
- You should have proposed several kind of movies, plus several ranges of bitrates.

This test will only give which encoder is the best at encoding some scenes of Harry Potter II at a specific bitrate....
Personnally, I think the test driven by FishMan was really more interesting, he encoded several clips of different movies, then he showed this encoded clips at his customers in his video shop...those persons didn't even know the concept of encoding, and they had to choose which pictures they preferred.

You're saying that it's not based on perceptual results, you should know that the MPEG2 compression is fully based on the human visual perception error....

Anyway, if I have enough time for it, I'll give a try to this test.....

P.S. : Don't say that I'm anti-french...I'm from France too ! (but living in Canada now) ;)

hank315
14th August 2005, 01:57
Still doesn't work, got the next error:
the named argument"lumimask" to SSIM had the wrong type

Sagittaire
14th August 2005, 02:08
My SSIM plugin isn't good ...lol
Here the update with good version ... :rolleyes:
http://multimediacom.free.fr/Download/SSIM.rar

very sorry for the desagrement ... :stupid:

hank315
14th August 2005, 02:15
You're saying that it's not based on perceptual results, you should know that the MPEG2 compression is fully based on the human visual perception error....I totally agree, for me this is also the first test based on just values, I always used visual perception for tweaking values etc.
But it is meant to be a test just based on the metrics.

Sagittaire
14th August 2005, 02:15
- Why only Harry Potter II ?!? Some encoders are good at interlaced movies others no....Some are good at low bitrates others no.....and so on
- You should have proposed several kind of movies, plus several ranges of bitrates.

It's true but:
1) my ftp is limited to 1 Go : impossible for me to post 10 trailers
2) 1800 Kbps "Mini DVD bitrate" is only the first round
3) high bitrate (4 Mbps and more) are not very interessing because all MPEG2 codec are good in this zone (shrink is good at 4 Mbps and more ... lol)

Sagittaire
14th August 2005, 02:19
A - Introduction

The purpose of this challenge is to determine which is the best codec for the metrics and only for the metrics : this test will not speak about subjective visual quality. If you want subjective visual comparison download sample and compare yourself ...

not subjective test ... but metric test. The best is the best for metric and only for metric in this test.

hank315
14th August 2005, 02:53
The new SSIM.dll works OK, thanks.

By accident I used my latest build in the previous post, corrected values for HC015:
|--------------|---------|---------|---------|---------|
| Codec | Bitrate | Size | OPSNR | SSIM 2 |
|--------------|---------|---------|---------|---------|
| TMPGEnc | 1787 | 27934 | 45.45 | 80.81 |
| CCE | .... | ..... | ..... | ..... |
| Canopus | .... | ..... | ..... | ..... |
| QEnc | .... | ..... | ..... | ..... |
| HC015 | 1792 | 28109 | 46.48 | 80.93 |
|--------------|---------|---------|---------|---------|settings used:

*PROFILE best
*INFILE D:\...\test.avs
*OUTFILE test.m2v
*ASPECT 4:3
*CQ 6.6
*DC_PREC 8
*CUSTOMMATRIX
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

16 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

Kika
14th August 2005, 03:09
@hank315
Do you remember our conversation by PM?
Your Encoder is just great, but it can be better if you implement a compression mode without constand quantization. HCenc is very close to TMPGEnc, and i guess, your routines are able to do much more.

dragongodz
14th August 2005, 03:18
dont expect QuEnc to be so great at the moment because of the work being done with ratecontrol. then again its been proved before that metrics are not always reliable but Sagittaire already knows this but they are all he really seems interested in.

http://forum.doom9.org/showthread.php?t=90784

Sagittaire
14th August 2005, 12:00
dont expect QuEnc to be so great at the moment because of the work being done with ratecontrol. then again its been proved before that metrics are not always reliable but Sagittaire already knows this but they are all he really seems interested in.


All video codec developper in the world think the opposite ...



PSNR at constant quantizer gives a good idea of the raw efficiency since this is what core encoder try to optimize most of the time.
MPSNR/OPSNR add some hints about rate-control and SSIM (JND metrics or whatever) add clues about adaptive quantization.

A codec which is inferior is those 3 metrics will almost surely be seen as subjectively inferior.

Besides, subjective testing is also very difficult to do and is not always reliable.


Find me only one exemple with this situation:
codec A visualy very better than codec B
Codec B very better for metric than codec A


but anyway this is not the challenge objective : The purpose of this challenge is to determine which is the best codec for the metrics and only for the metrics : this test will not speak about subjective visual quality. If you want subjective visual comparison download sample and compare yourself ...

Nic
14th August 2005, 12:15
Lets not get into a discussion over whether metric tests are valid or not. That's been discussed to death on these forums.

Lets keep this thread on topic as i'm sure people realise that metric tests are not 100% accurate on which codec creates the best output for an individual. The only way for an individual to ascertain that is to test themselves.

Good luck with your tests Sagittaire, Glad to see Hank's encoder doing so well. Maybe this can help us tune QuEnc in the future....

-Nic

Sagittaire
14th August 2005, 12:25
@hank315
Do you remember our conversation by PM?
Your Encoder is just great, but it can be better if you implement a compression mode without constand quantization. HCenc is very close to TMPGEnc, and i guess, your routines are able to do much more.

multipass is better for target bitrate and quality but make constant quant for MPEG2 is not a bad choice (not the best but not bad): perhabs bframe with light ratio/offest (1.25/1.00) could be a good idea ...

Sagittaire
14th August 2005, 15:12
1) Update with libabcodec core class codec ...

2) Libavcodec done very excellent result. QEnc seem don't use the best possible setting for libavcodec ... perhabs "insame mode" could be good idea for low bitrate. With my setting mencoder done 10 fps on my sempron 3000+.

3) Adaptative quantisation (with or without psy masking) are MPEG2 DVD compliant ? because if I use Adaptative quantisation with mencoder result can be still better.

4) Volonters for CCE and Canopus ... ???

dragongodz
15th August 2005, 01:18
Lets not get into a discussion over whether metric tests are valid or not. That's been discussed to death on these forums.
sorry Nic, it wasnt meant to be a debate just a warning to the newer members i see posting, and there are quite a few i have seen lately. so this is the last post i will say anyhing about it because as you say it has been talked about many times before.

All video codec developper in the world think the opposite
now that is a big call if i ever heard one. lets get Babayaga's meaning correct first.
MPSNR/OPSNR add some hints about rate-control and SSIM (JND metrics or whatever) add clues about adaptive quantization.
what this means is they can be useful in development and trying to spot any major problems. it does not mean they will tell you what looks better to everybody. there is a BIG difference.

Find me only one exemple with this situation:
i am pretty sure i mentioned in the past major PSNR failure thats mentioned in the massive Rejig thread. that is Makira made some changes to the requant engine and increased PSNR, problem was it also turned the output blocky and bad. so there is a real life example for you. i wont bother to mention all the times people have said they prefer different clips/examples on here. there is so many that people should be able to find them for themselves.

dragongodz
15th August 2005, 01:24
QEnc seem don't use the best possible setting for libavcodec ... perhabs "insame mode" could be good idea for low bitrate.
QuEnc does have an insane setting. also note that the latest versions of QuEnc dont use libavcodecs ratecontrol for 2 pass because of its bitrate spiking etc.
as i already said, ratecontrol is being worked on in QuEnc.

HC015 (lavc?)
HC != lavc. :)

Sagittaire
15th August 2005, 02:14
i am pretty sure i mentioned in the past major PSNR failure thats mentioned in the massive Rejig thread. that is Makira made some changes to the requant engine and increased PSNR, problem was it also turned the output blocky and bad. so there is a real life example for you. i wont bother to mention all the times people have said they prefer different clips/examples on here. there is so many that people should be able to find them for themselves.

Perhabs with APSNR (easy to corrupt with RC tweak ... example in most case CBR is better than VBR for this metric) but not with APSNR, OPSNR and SSIM ... anyway my test is only metric test ...


and very good job for Qenc (RC with ffdshow, mencoder is buggy, quant selection is buggy to). In fact I can make better encoding with mencoder but in real situation make encoding with mencoder is in practice very difficult ...

Here my profil for mencoder for best result in MPEG2 (but 2 more times slowly than QEnc )

mencoder.exe MPEG2.avs -o MPEG2-CM.m2v -ovc lavc -lavcopts vcodec=mpeg2video:vqmin=1:vqscale=3:vrc_maxrate=9800
:vrc_buf_size=1835:keyint=15:vqcomp=1.0:vmax_b_frames=2
:vb_strategy=0:vb_qfactor=1.5:vb_qoffset=0:preme=2:dia=6:predia=6
:mbd=2:mbcmp=262:ildctcmp=262:precmp=262:cmp=256:subcmp=262
:mv0:trell:cbp:psnr:aspect=4/3
: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

SAPSTAR
15th August 2005, 21:18
Hmmm maybe another rule is missing :
You should give a matrix....because I made several tests with CCE, QuEnc, ... by changing the matrix you change "completely" the results !!!!!

hank315
15th August 2005, 22:31
@Sapstar
Use these matrices:
intra
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
inter
16 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

I tried some others but these matrices gave the lowest PSNR.

Nic
15th August 2005, 23:51
I don't understand why we are bothering to crop & resize etc ? Surely that affects SSIM/OPSNR when comparing with a complete original image. Shouldn't we just be encoding the MPEG as is without applying any filters? Adding borders etc will surely effect things unless we do exactly the same to the "video" parameter..... ???

-Nic

Sagittaire
16th August 2005, 02:12
Update with KVCD "six hours" TMPGEnc template ... not better for metric and very blur for my eyes ... I prefer my Sagittaire Matrix (better for metric and better for my eyes too ... lol). QEnc (and libavcodec) seem very better and by far for metric (1.6 dB and SSIM 2 point are very high value for this quality level). I don't know if adaptative quantisation is DVD compliant (qprd and psymasking setting in mencoder) : Libavcodec could be still very better for metric


I don't understand why we are bothering to crop & resize etc ? Surely that affects SSIM/OPSNR when comparing with a complete original image. Shouldn't we just be encoding the MPEG as is without applying any filters? Adding borders etc will surely effect things unless we do exactly the same to the "video" parameter..... ???

-Nic

Very good question ... ;)

Yes and No : black borders or black frame increase artificially the scores for OPSNR but don't change hierarchy (not true for APSNR). SSIM use lumimask ponderation and result could be very close between test with or without blackborders/black frames

It's the (mathematical) theory but in practice?

With black borders (image tested is 720*576):

|-----------------|---------|---------|---------|---------|
| Codec | Bitrate | Size | OPSNR | SSIM 2 |
|-----------------|---------|---------|---------|---------|
| TMPGEnc | 1803 | 28130 | 45.26 | 80.67 |
| QEnc (lavc) | 1797 | 28077 | 46.85 | 82.66 |
| mencoder (lavc) | 1798 | 28098 | 47.10 | 83.14 |
|-----------------|---------|---------|---------|---------|
SSIM 0: Lumimask Off
SSIM 2: Lumimask On (One2Tech Patch)



Without black borders (image tested is only real image in 720*320):

|-----------------|---------|---------|---------|---------|
| Codec | Bitrate | Size | OPSNR | SSIM 2 |
|-----------------|---------|---------|---------|---------|
| TMPGEnc | 1803 | 28130 | 42.71 | 80.38 |
| QEnc (lavc) | 1797 | 28077 | 44.30 | 82.40 |
| mencoder (lavc) | 1798 | 28098 | 44.55 | 82.89 |
|-----------------|---------|---------|---------|---------|
SSIM 0: Lumimask Off
SSIM 2: Lumimask On (One2Tech Patch)



Conclusion: blackborders or blackframe change final result but not hierarchy and not difference between codec. It's mathematicaly true (theory and practice) for Overall PSNR and SSIM but not for Average PSNR (theory and practice). You can make OPSNR/SSIM test with or without blackborders ...


Same conclusion with pre-process filtrering (resize, denoising, adaptative denoising ...) : change final result but not hierarchy and not difference between codec.

Sagittaire
16th August 2005, 02:24
You should give a matrix....because I made several tests with CCE, QuEnc, ... by changing the matrix you change "completely" the results !!!!!

you can use the best matrix for you and your eyes for all test. You can change all setting (open/close GOP, DC 8/9/10, custom matrix ...) if you want but your stream must be DVD compliant (MP@ML profil, Max Frame for PAL GOP is 15, 2 bframe no adaptative, max_vector +/- 128, VBV specification ...)

Audionut
16th August 2005, 05:42
HC enc 015A beta

bitrate=1801
size=28252
psnr=46.244
ssim2=81.538

profile=best
dc precision=9
Custom Matrix (http://rapidshare.de/files/4026015/Audionut_s_hc_enc_matrix.rar.html)

Sagittaire
16th August 2005, 09:26
@ Audionut

worst PSNR but better SSIM ... SSIM is IMO the best metric.

anybody for CCE and Canopus Pro Codec ... ???

Nic
16th August 2005, 10:09
@Sagittaire: No you're right it probably won't change the hierarchy. But it still makes no sense to me why were doing it that way.

Audionut
16th August 2005, 10:51
@Sagittaire: No you're right it probably won't change the hierarchy. But it still makes no sense to me why were doing it that way.

I agree.

I encode to mpeg2 for dvd usage.

For dvd playback I want to keep a 16:9 ratio, not 4:3.

Audionut
16th August 2005, 10:52
@ Audionut

worst PSNR but better SSIM ... SSIM is IMO the best metric.

anybody for CCE and Canopus Pro Codec ... ???

That was the first thing I noticed.

I agree, ssim is better.

SAPSTAR
16th August 2005, 14:40
@Sagittaire: No you're right it probably won't change the hierarchy. But it still makes no sense to me why were doing it that way.
I totally agree with you....we should keep the original movie, and use a "normal" bitrate for DVDs ~2500kbps.....

@Hank315 : Thank you very much for the info, but it points out another issue, you had to try several matrices to obtain the best PSNR, so it's more a challenge between people doing the encoding than the encoders themselves, right ?!? Because the newbie won't be able to choose the right settings/matrix right away.....

Sagittaire
16th August 2005, 14:55
Why this particular profil?
DVD standard MPEG2 MP@ML Pal DAR 4/3 PAR 12:11 profil

With this particular avs script?
source=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\azerty.d2v",idct=2)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)
Return(source)

1) Because I test very low bitrate for MPEG2. With PAL 4/3 DAR real image (without blackborders) is 720*320 for 2.35:1 HPII trailer. With PAL 16/9 real image must be 720*432 for 2.35:1 HPII trailer. 311 000 pixels for 16/9 vs 230 000 pixels for 4/3. 230 000 pixel is better for very low bitrate like 1800 Kbps.

2) Because I test with complete mod16 resize. Top and bottom blackborder are 720*128 and real image is 720*320. It's the ideal resize for DCT in YV12 mode with MPEG2. No borders ringing with this resize ... border-image zones transitions are perfect.

SAPSTAR
16th August 2005, 15:37
Size : 28242
SSIM : 81.11472561
PSNR : 46.2581

These results were obtained without any tweaking....just by using a regular ECL script leaving everything "standard". I used ECLCreate to generate the ECL file, and I left AQE calculating the matrix by itself.
I can send the mpv file on request.

[EDIT] I forgot to mention, it's a 2 passes encode....

FYI the generated matrix was :
8 14 16 19 22 35 52 62
14 14 19 20 22 33 57 58
16 19 22 22 34 53 60 64
19 19 22 44 52 60 64 67
19 22 37 54 59 63 67 73
22 38 49 59 63 67 73 80
22 54 58 62 65 71 79 88
43 58 63 65 71 79 89 100

16 18 19 21 24 31 39 45
18 19 21 23 25 31 39 43
19 21 24 27 32 38 43 48
21 23 27 37 42 44 48 51
24 25 32 43 48 49 51 52
29 32 39 44 49 51 52 54
35 39 43 49 51 52 56 56
42 43 48 51 52 54 56 58

Sagittaire
16th August 2005, 16:24
thx SAPSTAR ... update with AQE

These results were obtained without any tweaking
Challenge is to make the best possible encoding ... you can make and you must make tweaking with AQE

Libavcodec seem very powerfull (perhabs the most powerfull) for metric. always nobody for the tests on the CCE and Canopus Pro Coder ... ???

ronnylov
16th August 2005, 17:36
Rule 3 : Bitrate

You must use these bitrate/size for encoding:

The first round use is very low bitrate for MPEG2 : maximum bitrate is 1800 Kbps for mini-DVD profil encoding.
Mini-DVD: Maximun 1800 Kbps for Video Elementary Stream or 28125 Ko for m2v file.


When you say maximum bitrate, do you mean maximum average bitrate?
If I use VBR encoding the maximum peak bitrate would be higher than the average bitrate.

I may try Mainconcept encoder and Canopus Procoder.

Sagittaire
16th August 2005, 17:55
When you say maximum bitrate, do you mean maximum average bitrate?
If I use VBR encoding the maximum peak bitrate would be higher than the average bitrate.

I may try Mainconcept encoder and Canopus Procoder.

Yes, I will corrige that ... it's not clear.

It's maximum average bitrate. you can choose the max peak bitrate as you want if you respect DVD VBV specification (9800 Kbps or less).

I may try Mainconcept encoder and Canopus Procoder.

cool ... use the best possible setting (time encoding is not a problem here).

hank315
16th August 2005, 21:42
@Sagittaire
I think people using CCE wil have trouble using your scripts.
CCE shifts the frames 1 pixel up, metric results will ofcourse be very bad...

HC != lavcHe actually meant HC is not based on libavcodec.
Because it's in Fortran here's the right syntax: HC /= lavc or HC .NE. lavc ;)

ronnylov
17th August 2005, 00:01
Mainconcept MPEG Encoder 1.4.2

Filesize: 28744120 byte
Average bitrate: 1783 kbit/s

Results:
OPSNR: 44.93
SSIM 2: 79.85

Settings:
DVD 720x576 pixel 25.00 fps
Progressive frame, no deinterlacing
Search method: 15
Search range: 31
2-pass encoding
Aspect ratio 4:3 display
GOP structure: I-frames 15, P-frames 3, Auto GOP VCSD, Closed GOP interval 0
Bitrate type: variable bitrate
Rate control mode: 1
Maximum (kbps): 8000
Average (kbps): 1800
Minimum (kbps): 200
Profile ID: Main Profile
Level ID: Main Level
Noise sensistivity: 1
Motion search mode: 15
Do half-pel search: enabled
Motion search pixel movement: disabled
Input video is 16-235: disabled
User quant matrices: disabled

Additional settings:
Sequence extention - progressive sequence: 1
Picture coding extension - Intra DC Precision: 0 (0 = 8 bits)
Quantization Scale Type: non-linear on all frame types
Intra VLC Format: VLC table 1 for all frame types
Use Alternate scanning pattern: 0 (Zig-Zag) on all frame types

Sagittaire
17th August 2005, 00:39
@ hank315

thx ... I will try to solve this problem ... !!!
but it's strange if CCE don't respect avisynth script .... mod16 resize for blackborders is very important for quality with very low bitrate.

@ ronnylov

Mainconcept MPEG Encoder 1.4.2 seem not able to fight with other encoder for low bitrate ... . Visual quality is really worse than for the others encoders ?

ronnylov
17th August 2005, 01:25
Canopus Procoder version 1.50.22.0

Because of the rule that I should use the specific source script I could not adjust the levels in avisynth so I used the built-in Procoder video filter "601 Correction - Shrink Color Space". This is needed to get similar brightness and contrast in the encoded file as the source. Maybe it is possible to get better results by tweaking in avisynth before feeding the encoder. I think Coloryuv levels TV->PC scale or PC->TV can be used (don't remember which one) instead of the Procoder internal filter.

Filesize: 28799345 bytes
Average bitrate: 1786 kbit/s

Results:
OPSNR: 44.50
SSIM 2: 81.20

Settings:
Source:
Video Frame Size: 720x576
Frame rate 25.00
Interlacing: Non-Interlaced
Aspect ratio: Video [4:3], Pixel [16:15]
Advanced - Video filter - 601 Correction - Shrink Color Space

Target:
Format: User Defined
Stream type: MPEG2 video + Wave file
Speed/Quality Mode: Mastering-Quality
CBR/VBR Type: 2PASS_VBR
Video bitrate: 1800
Max bitrate: 8000
Use Closed GOP: disabled
Number of frames in a GOP: 15
Distance between I/P frame: automatic
Use sequence header interval every GOP: enabled
VBV buffer size: 224
DVD compability mode: enabled
Profile/Level: MP@ML
3-2 pulldown: No
DC Precision: 8

ronnylov
17th August 2005, 01:32
@ hank315

thx ... I will try to solve this problem ... !!!
but it's strange if CCE don't respect avisynth script .... mod16 resize for blackborders is very important for quality with very low bitrate.

@ ronnylov

Mainconcept MPEG Encoder 1.4.2 seem not able to fight with other encoder for low bitrate ... . Visual quality is really worse than for the others encoders ?

Compared to Procoder the video is more blocky when enoded with Mainconcept at this low bitrate. I even tried the custom matrices in Mainconcept but could not get any better results than with the default matrices. I wonder why I get lower OPSNR but rather high SSIM with Procoder? Could still be some problem with levels and colors.

Sagittaire
17th August 2005, 09:38
I wonder why I get lower OPSNR but rather high SSIM with Procoder? Could still be some problem with levels and colors.

Because color level respect is very important for OPSNR : it's a simple pixel level comparison. If you make very simple modification (+1 for Y level for example) OPSNR will not good. It's not the case with SSIM ... HVS modelisation is very good (but not complete and not perfect) and result are more reliable. Anyway procoder modifies the source without "authorization". if I want a filter I puts it in pre-process. video codec must have in output an object nearest possible to that in input. It's not the case with Procoder because the source is internaly modified ... :mad:

Little example with CCIR-601 compliant digital video correction with the same source (limiter only with video in avs metric script)
PSNR : 71.86 db
SSIM : 99.99 and in practice perfect scrore

use these script for better result for OPSNR and Procoder:

source=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\azerty.d2v",idct=2)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)
source=Limiter(source,16, 235, 16, 240)
Return(source)


# --> Video Opening <--

source=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\azerty.d2v",idct=2)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)
source=Limiter(source,16, 235, 16, 240)

video=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\qwaerty.d2v",idct=2)

# --> PSNR analysis <--
compareYV12(video,source,"YUV","PSNR-MPEG2.log")

Sagittaire
17th August 2005, 10:11
Many thinks that visualy the best MPEG2 encoder available is Libavcodec. I don't know if it's true but libavcodec is certainely the best for metric and by far. QuEnc seem to be most reliable in libavcodec gui serie (good RC, good quality, facility of use) ... it's a very good job Nic.

SAPSTAR
17th August 2005, 15:07
Many thinks that visualy the best MPEG2 encoder available is Libavcodec. I don't know if it's true but libavcodec is certainely the best for metric and by far. QuEnc seem to be most reliable in libavcodec gui serie (good RC, good quality, facility of use) ... it's a very good job Nic.
Hmmm beware, you should say that :
At this bitrate, for that movie, with your tweakings, the metrics are better for the libavcodec (or QuEnc in this case)....but it would be a really fast conclusion to say it's true for any kind of movie, bitrates, and so on......
I tend to agree with you that this lib is a very powerful one, it allows many tweakings. But please don't make a general rule from a simgle experiment. And I don't say that to fight this idea, after all AQE uses part of this lib too ! :)

Sagittaire
17th August 2005, 15:45
Hmmm beware, you should say that :
At this bitrate, for that movie, with your tweakings, the metrics are better for the libavcodec (or QuEnc in this case)....but it would be a really fast conclusion to say it's true for any kind of movie, bitrates, and so on......
I tend to agree with you that this lib is a very powerful one, it allows many tweakings. But please don't make a general rule from a simgle experiment. And I don't say that to fight this idea, after all AQE uses part of this lib too ! :)

Yes, yes and ... yes. you are right ... :goodpost:

I would have to specify for metrics with this source, with this bitrate, with this avs script ... ect ect ect ... the best is ...

I will make another test with high quality source (certainely MPEG2 "superbit" source trailer) for another round test : "backup DVD9 -> DVDR5" DVD standard MPEG2 MP@ML Pal DAR 16/9 profil

IgorC
18th August 2005, 01:25
I haven't intention to go offtopic talking about visual quality. But it's very strange. It's first time I disagree with SSIM while the difference is so big for metrics. Maybe cause it because of good quality for both codecs.
I asked to one person to help me to do a blind test between video clips (Harry Potter) of TMPG and Mencoder.
TMPGEnc (OPSNR 45.26, SSIM 80.67) and mencoder (lavc) (OPSNR 47.10,SSIM 83.14)

Result was unpredictible. In many cases I prefered TMPGEnc to Mencoder, although difference between these codecs is 2.5 SSIM. It's a first time when I see too big difference for SSIM result and oposite visual mark.

SAPSTAR
18th August 2005, 14:24
I haven't intention to go offtopic talking about visual quality. But it's very strange. It's first time I disagree with SSIM while the difference is so big for metrics. Maybe cause it because of good quality for both codecs.
I asked to one person to help me to do a blind test between video clips (Harry Potter) of TMPG and Mencoder.
TMPGEnc (OPSNR 45.26, SSIM 80.67) and mencoder (lavc) (OPSNR 47.10,SSIM 83.14)

Result was unpredictible. In many cases I prefered TMPGEnc to Mencoder, although difference between these codecs is 2.5 SSIM. It's a first time when I see too big difference for SSIM result and oposite visual mark.
Which proves what I always said....the MPEG2 compression is based on the visual perception, errors are there but not seen, that's why I think it's really hard to determine the VISUAL quality by simple comparisons....For example : If you watch your movie on a 30" TV at a distance of 90" the picture may be seen as perfect...and then you watch it at 30" from the screen and it's not that good at all !!!!
Conclusion : This test is interesting from a pure mathematical point of view, but not from a practical point of view.

SAPSTAR
18th August 2005, 17:07
New results coming from the very last version of AQE, the one I will release this coming weekend :
Size : 28244
SSIM : 82.97215667
PSNR : 46.7218

Those results were still obtained without any manual tweakings, my main goal with AQE is to make an encoder able to make the right choices by itself, to allow newbies to achieve quality encodings....

Boulder
19th August 2005, 09:14
@Sagittaire
I think people using CCE wil have trouble using your scripts.
CCE shifts the frames 1 pixel up, metric results will ofcourse be very bad...

CCE doesn't shift anything if you set the offset line value to 0.

I might torture CCE if I have the time this weekend.

Sagittaire
19th August 2005, 14:22
New results coming from the very last version of AQE, the one I will release this coming weekend :
Size : 28244
SSIM : 82.97215667
PSNR : 46.7218

Those results were still obtained without any manual tweakings, my main goal with AQE is to make an encoder able to make the right choices by itself, to allow newbies to achieve quality encodings....

IMO metric optimisation is alway the best way for initial codec otimisation (RC optimisation with OPSNR for example). In second time you can try to make very specific HVS optimisation with custum matrix, lumi/dark masking (these optimisations decrease very little the metric like PSNR)


I might torture CCE if I have the time this weekend.

I am really very curious to see the result

hank315
19th August 2005, 16:26
CCE doesn't shift anything if you set the offset line value to 0.Missed that one, guess I'm still a CCE newbie :)

Values for CCE Basic 2.70.01.04:
file size: 28179
PSNR: 45.83
SSIM2: 78.76

settings used:
min/average/max bitrate: 500/1800/9000
progressive, dc precision 8, zigzag scanning

Boulder
19th August 2005, 16:29
Missed that one, guess I'm still a CCE newbie :)

Let's just say that CCE is far from clear when certain things are concerned. In the v2.50 days it was even more problemous :scared:

I'll have to try and beat your results tomorrow ;)

IgorC
20th August 2005, 02:25
Missed that one, guess I'm still a CCE newbie :)

Values for CCE Basic 2.70.01.04:
file size: 28179
PSNR: 45.83
SSIM2: 78.76

settings used:
min/average/max bitrate: 500/1800/9000
progressive, dc precision 8, zigzag scanning
These settings are far to be best for metrics.

It should be better
dc precision 10
progressive
fades on the dark?
multipass (at least 3 )
Max bitrate 9000 kbit/s is useless for 1800 kbps video.
Is Luminace level 0-255 will be better for metrics?

Since I don't have a pro version of CCE 2.7 I asked one guy to encode it with all conditions and terms of this test.

Boulder
20th August 2005, 10:40
dc precision 10

DC precision of 8 bits should be better for a low bitrate. Remember, we are not talking about average DVD bitrates here.

multipass (at least 3 )

Has been tested and the conclusion is that it doesn't matter. Two passes is as good as gazillion. CCE has a very good rate control so it really doesn't need any more than 2.

Is Luminace level 0-255 will be better for metrics?

It's not used because you feed YUY2 data in CCE.

Sagittaire
20th August 2005, 13:58
Has been tested and the conclusion is that it doesn't matter. Two passes is as good as gazillion. CCE has a very good rate control so it really doesn't need any more than 2.

Certainely visually for 128 min movie but I think that 3 pass could be very good for 128 sec HPII trailer and metric. x264 RC is very good too but 3 pass are alwayes little better for metric ...

It's not used because you feed YUY2 data in CCE.

Yes, can be a problem with OPSNR / SSIM : here little simulation with YV12 -> YUY2 -> YV12 convertion in CCE encoding process with the same source.

OPSNR : 65.88 dB (be carrefull it's a very high value ... H264 q1 is not better for OPSNR)
SSIM : 99.83 (in practice it's perfect ...)

Conclusion : YUY2 internaly space color could be bad for OPSNR but certainely not for SSIM

Audionut
21st August 2005, 02:08
It should be better
dc precision 10


DC precision of 8 bits should be better for a low bitrate. Remember, we are not talking about average DVD bitrates here.


In my tests with HC enc. DC precision of 9 was the best as far as SSIM is concerned.

Audionut
21st August 2005, 02:14
Max bitrate 9000 kbit/s is useless for 1800 kbps video.


HC Enc!

Max Bitrate 9300 = the stream maxed out at 6500. (Depending on matrix used etc.)

I think the idea is to let the encoder decide as much as possible.
Setting a max bitrate of say 5000 will lower the SSIM.

Boulder
21st August 2005, 10:59
Setting a max bitrate of say 5000 will lower the SSIM.
I noticed that as well, at first tried Hanks settings with max at 5000 and got lowish values. Then again, I couldn't get the same level as Hank with CCE SP 2.70 even if I used exactly the same settings and the matrix he posted earlier in this thread. Unfortunately I don't have the time to try any tweaking so some CCE bloke might want to give it a good try.

hank315
21st August 2005, 17:00
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...

Wilbert
22nd August 2005, 20:01
@hank,

i4004, asked me to ask you the following :)

In what way is the mencoder clip not MPEG compliant? Did Sagittaire forgot to use
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.

hank315
22nd August 2005, 21:53
@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 :rolleyes:
Because the Quenc encoding was OK maybe it's just caused because Sagittaire used a version of Mencoder with an older libavcodec.

Sagittaire
22nd August 2005, 22:25
motion vector range ... perhabs. I think that for MPEG2 compliant stream max vector must be 128 ... ???

hank315
22nd August 2005, 22:42
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)

Wilbert
23rd August 2005, 00:24
Thanks for the explanation!

Sagittaire
23rd August 2005, 16:15
Update with new mencoder sample:

Mencoder (http://multimediacom.free.fr/Download/Mencoder.m2v) with Compliant Vector Range Limitation

Special Mencoder (http://multimediacom.free.fr/Download/Mencoder-Optimum.m2v) 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 ... ???

hank315
23rd August 2005, 22:32
@Sagittaire
Both clips seem OK.
What did you change in your parameters?

Sagittaire
23rd August 2005, 23:38
@Sagittaire
Both clips seem OK.
What did you change in your parameters?

me_range=128 in mencoder CLI

Here new encoding (http://multimediacom.free.fr/Download/MPEG2-HVS.m2v) with HVS optimisation
PSNR : 47.19 dB
SSIM : 83.77 .... :eek:

I think that will be very hard for the other MPEG2 coder to obtain better metrics ... lol

Sagittaire
25th August 2005, 01:04
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 (http://multimediacom.free.fr/Download/CCE.m2v)

It's very strange ... nobody can do better ... ???

Audionut
25th August 2005, 02:53
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.

hellfred
25th August 2005, 21:47
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 (http://www.mplayerhq.hu/homepage/design7/info.html#docs) .

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 (http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/DOCS/tech/encoding-guide.txt?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=MPlayer&sortby=date)

ronnylov
27th August 2005, 01:28
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

danpos
27th August 2005, 15:32
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,

hellfred
27th August 2005, 16:56
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 (http://www.mplayerhq.hu/homepage/design5/info.html#docs).
The CSV-repository can be browsed, too, so reading the encoding-guide (http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/DOCS/tech/encoding-guide.txt?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=MPlayer&sortby=date) online is possible, too.

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

Hellfred

Sagittaire
27th August 2005, 18:58
Little demo with mencoder:

Serenity Trailer (http://multimediacom.free.fr/Download/Test.rar)
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

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

Pookie
27th August 2005, 19:09
Sagittaire: VERY nice encoding job! Would you please post the specific command line parameters that you used in mencoder ? TIA.

Sagittaire
27th August 2005, 19:18
3 pass High quality - Good Speed

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

danpos
27th August 2005, 20:45
@Hellfred

Thanks mate !!

@Sagittaire

Gotcha!!

Cya!

hank315
31st August 2005, 00:21
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

hellfred
31st August 2005, 09:57
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

Did you have a look at ffmpeg, the project of libavcodec itself. If you do not need mencoders advanced filters, you can use ffmpeg.exe for encoding using libavocodec, too.

Hellfred

Xero_M
1st September 2005, 04:21
@Sagittaire

Do you know a mpg2 frontend for mencoder. I have tested MeWig, I culdnt get it to make mpg2. I must test mencoder when you get so gooood result :)

hellfred
1st September 2005, 09:55
@Sagittaire

Do you know a mpg2 frontend for mencoder. I have tested MeWig, I culdnt get it to make mpg2. I must test mencoder when you get so gooood result :)
Most of the frontends are listed on MPlayers hompage, see "related Projects" The number of win32 frontends for win32 is limited.
MeWig (http://mewig.sf.net/)
So if you do not get it running, it will be hard to get a suitable GUI frontend under win32. Linux/Unix has lots of frontends for mencoder.
So you may reconsider working with batchfiles, just replacing the names of the files to be encoded and tweaking some settings. Good comands are given in this thread to get you started.


Hellfred

Sagittaire
4th September 2005, 16:50
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


Ultimate HVS encoding with hank315 "transcode"

Original file size: 29276 KB
bitrate: 1865 Kb/s
PSNR: 47.34
SSIM2: 84.23

Optimized file size: ~28250 KB
bitrate: ~1800 Kb/s
PSNR: 47.34
SSIM2: 84.23

ronnylov
5th September 2005, 00:54
Hello!

I remembered not having the problems with levels when converting some huffyuv captures to DVD with Procoder so I was thinking maybe it works better with YUY2 input instead of YV12. I converted the input to YUY2 and then the level problem was gone and I could get rid of the source filter in Procoder.

I used following input script for Procoder (and did not change the SSIM2 or PSNR scripts):


source=Mpeg2Source("I:\Encoding challenge\Source\Harry Potter II Trailer.d2v",idct=2)
source=ConvertToYUY2(source)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)
Return(source)


First the results with Procoder version 1.50.22.0 (using same settings as before but without the source filter):
File size: 28135 KB (28809462 bytes)
Bitrate: 1793 kbit/s
OPSNR: 45.86
SSIM 2: 81.68


Then I did another test with a newer version of Canopus Procoder.
Canopus Procoder 2 Version 02.04.02.00:
File size: 28126 KB (28800108 bytes)
Bitrate: 1793 kbit/s
OPSNR: 46.49
SSIM 2: 82.49

It seems that Procoder 2.0 has improved on the metrics with this source video. There was a minimum bitrate setting in Procoder 2.0 which I set to 500 kbit/s. In Procoder 1.5 it was only possible to set average and maximum bitrate but not possible to set minimum bitrate. Maybe that is a reason for the difference? I have not tried to find the optimal settings for minimum and maximum bitrate.

Prodater64
5th September 2005, 03:56
@Sagittaire: When you will post some statistics/results.

Thanks.

ronnylov
5th September 2005, 11:33
Ultimate HVS encoding with hank315 "transcode"

Original file size: 29276 KB
bitrate: 1865 Kb/s
PSNR: 47.34
SSIM2: 84.23

Optimized file size: ~28250 KB
bitrate: ~1800 Kb/s
PSNR: 47.34
SSIM2: 84.23

Could you give us some details on how the "hank315 "transcode"" is made?
Are you using ReJig? Why does the metric values not change when transcoding to a slightly lower bitrate?

hank315
5th September 2005, 12:55
Could you give us some details on how the "hank315 "transcode"" is made?
Are you using ReJig? Why does the metric values not change when transcoding to a slightly lower bitrate?It's not a real transcode but just a trick which can be done with all libavcodec encodes which have black top and bottom bars.
These libavcodec clips don't skip Macro Blocks in B-frames so they need 35 bytes for each (black) slice while all other encoders only need 5.
This clip has 16 black slices in each B-frame and over 2000 B-frames so it's an easy way to gain approx. 1 MB without touching the real content.
It takes about 5 minutes to replace these slices using a hex editor ;)

Sagittaire
6th September 2005, 00:56
Procoder update

hank315
8th September 2005, 22:43
Just encoded the test clip with HC016, metrics are a little bit better than HC015:
PSNR: 46.47
SSIM2: 81.65

Same settings (matrix etc.) are used.


For those who are interested, here's a link to the optimized Mencoder clip (27 MB):

http://hank315.dyndns.org/Mencoder_HVS_optimized.m2v

It should look the same, in fact it is the same...

mezzanine
21st September 2005, 11:18
We should have a new thread with a typical bitrate for dvd-r backups (around 3000), and no cropping and adding borders. Some encoders are not good for such low bitrates but excell at higher ones. (e.g. CCE SP outperforms QuEnc at 4000 according to my SSIM tests, allthough QuEnc looks better to my eyes)

SAPSTAR
21st September 2005, 21:30
We should have a new thread with a typical bitrate for dvd-r backups (around 3000), and no cropping and adding borders. Some encoders are not good for such low bitrates but excell at higher ones. (e.g. CCE SP outperforms QuEnc at 4000 according to my SSIM tests, allthough QuEnc looks better to my eyes)
Agreed....eyes and numbers are different, the MPEG compression is entirely based on the perceptual errors of the human eye...

Sagittaire
23rd September 2005, 13:18
We should have a new thread with a typical bitrate for dvd-r backups (around 3000), and no cropping and adding borders. Some encoders are not good for such low bitrates but excell at higher ones. (e.g. CCE SP outperforms QuEnc at 4000 according to my SSIM tests, allthough QuEnc looks better to my eyes)

In fact libavcodec outperform always all the other MPEG2 encoder for all bitrate ... :)

Sagittaire
11th March 2006, 14:50
update with mencoder 22.02.06

- add new adaptative bframe strategy
- add new bframe refine
- add RC tweak

mencoder progress always ... :D

dirio49
12th March 2006, 21:21
I can never figure out how to get mencoder:o

video_magic
12th March 2006, 22:51
Mencoder is often found in the Mplayer package.

You can find some Windows compiles from Sherpya on this page for Mplayer and Mencoder.
http://oss.netfarm.it/mplayer-win32.php

Also, you would typically run Mencoder from the command line (it is a CLI app (Command Line Application)) - this means through Windows going to a Command Prompt (Dos Window) and going to the Folder where you have the Mencoder.exe and then running it byt typing mencoder.exe options
:)

IgorC
16th April 2006, 01:39
update with mencoder 22.02.06

- add new adaptative bframe strategy
- add new bframe refine
- add RC tweak

mencoder progress always ... :D

Hello. Can you provide cli options used for these improvements?
Thank you.

Sagittaire
16th April 2006, 16:04
Hello. Can you provide cli options used for these improvements?
Thank you.

@echo off

@REM -----------------------------------------------------------------------------------------------
@REM
@REM MPEG2 Mencoder Profil
@REM
@REM -----------------------------------------------------------------------------------------------



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Output and Input files
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Input file name
set E_SRC=MPEG2.avs

@REM Output file name
set E_VID=MPEG2-HQ.m2v



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Rate control settings
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Set of bitrates
set E_BR=1800

@REM Set of max bitrates (use 9800 max for DVD compliant stream)
set VBV_MBR=9000

@REM Set of max buffer size (use 1835 max for DVD compliant stream)
set VBV_MBS=1835

@REM Set of ratio initial buffer occupency (0.9 is good value)
set VBV_IBO=0.9

@REM Set of first pass quantizer (2 is good value for high bitrate)
set E_IQ=3

@REM Set of min quantizer (1 is good value for high bitrate)
set E_MQ=2

@REM Set of quantizer variability [0.00;1.00] (0.75 is good value)
set E_VQ=0.75

@REM Set of inter quantizer masking [0.00;1.00] (0.00-0.50 is good interval)
set E_PMSK=0.00
IF "%E_MQ%" == "1" GOTO HIGH
set E_PMSK=0.50
:HIGH
set E_PMSK=%E_PMSK%



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> GOP structure
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Set of max interval KFrame (use 15 for DVD PAL and 18 for DVD NTSC)
set E_MIK=15

@REM Set of max BFrames [0;4] (use 2 max for DVD compliant stream)
set E_MBF=2

@REM Set of Adaptative BFrames [0;2] (desactived is 0, fast is 1 and slow is 2)
set E_ABF=2

@REM Set of Slow Adaptative BFrames Refine [0;10] (0 is full search, higher is faster)
set E_SBF=1



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Motion estimation settings
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Set of ME range [0;9999] (use 128 for DVD compliant stream)
set E_RME=128

@REM Set of Rate Distortion Optimisation [0;2] (2 is the best)
set E_RDO=2

@REM Set of diamond size [-99;6] (negatives values are adaptative diamond)
set E_DIA=1

@REM Set of comparison function for ME [0;2000] (0 is SAD, 1 is SSE, 2 is SADT, +256 for chroma ME)
set E_CMP=1

@REM Set of previous ME [0;2]
set E_PME=2

@REM Set of BFrame refinements [0;4] (Bframe Quality, 4 is best quality)
set E_BFR=4



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> VUI settings
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Display Aspect Ratio (4/3 or 16/9 for DVD compliant stream)
set E_DAR=4/3

@REM DC precision [8;10]
set E_DC=8

@REM Framerate (use 25 for PAL and 24000/1001 or 30000/1001 for NTSC)
set E_FPS=25

@REM Set intra matrix (use coef > 8 for DVD compliant stream with mencoder)
set E_INTRA=08,16,16,16,17,18,21,24,16,16,16,16,17,19,22,25,16,16,17,18,20,22,25,29,16,16,18,21,24,
27,31,36,17,17,20,24,30,35,41,47,18,19,22,27,35,44,54,65,21,22,25,31,41,54,70,88,24,25,29,36,47,65,
88,115

@REM Set inter matrix (use coef > 8 for DVD compliant stream with mencoder)
set E_INTER=16,16,16,16,17,18,21,24,16,16,16,16,17,19,22,25,16,16,17,18,20,22,25,29,16,16,18,21,24,
27,31,36,17,17,20,24,30,35,41,47,18,19,22,27,35,44,54,65,21,22,25,31,41,54,70,88,24,25,29,36,47,65,
88,115



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Mencoder CLI
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

ECHO.---------------------------------------------------------------
ECHO.First pass ...
ECHO.---------------------------------------------------------------
mencoder.exe -priority idle %E_SRC% -o NUL -ovc lavc -vf yuvcsp -ofps %E_FPS%
-lavcopts vcodec=mpeg2video:vpass=1:turbo:sc_factor=6:vqscale=%E_IQ%:keyint=%E_MIK%:vqcomp=%E_VQ%
:vmax_b_frames=%E_MBF%:vb_strategy=%E_ABF%:brd_scale=%E_SBF%:vb_qfactor=1.00:vb_qoffset=0.0
:vi_qfactor=1.00:vi_qoffset=0.0:me_range=%E_RME%:preme=%E_PME%:dia=1:predia=1:mbd=%E_RDO%:precmp=0
:cmp=0:subcmp=0:mv0:last_pred=0:dc=%E_DC%:psnr:aspect=%E_DAR%:inter_matrix=%E_INTER%
:intra_matrix=%E_INTRA%:p_mask=%E_PMSK%:vqmin=%E_MQ%:lmin=%E_MQ%:vqblur=0 -of rawvideo -ffourcc MPG2

@CLS

ECHO.---------------------------------------------------------------
ECHO.Second pass ...
ECHO.---------------------------------------------------------------
mencoder.exe -priority idle %E_SRC% -o NUL -ovc lavc -vf yuvcsp -ofps %E_FPS%
-lavcopts vcodec=mpeg2video:vpass=3:sc_factor=6:vbitrate=%E_BR%:keyint=%E_MIK%:vqcomp=%E_VQ%
:vmax_b_frames=%E_MBF%:vb_qfactor=1.00:vb_qoffset=0.0:vi_qfactor=1.00:vi_qoffset=0.0
:me_range=%E_RME%:preme=%E_PME%:dia=1:predia=1:mbd=%E_RDO%:precmp=0:cmp=0:subcmp=0:mv0:last_pred=0
:dc=%E_DC%:psnr:aspect=%E_DAR%:inter_matrix=%E_INTER%:intra_matrix=%E_INTRA%:p_mask=%E_PMSK%
:vqmin=%E_MQ%:lmin=%E_MQ%:vqblur=0:vrc_maxrate=%VBV_MBR%:vrc_buf_size=%VBV_MBS%:vrc_strategy=0
-of rawvideo -ffourcc MPG2

@CLS

ECHO.---------------------------------------------------------------
ECHO.Last pass ...
ECHO.---------------------------------------------------------------
mencoder.exe -priority idle %E_SRC% -o %E_VID% -ovc lavc -vf yuvcsp -ofps %E_FPS%
-lavcopts vcodec=mpeg2video:vpass=2:sc_factor=6:vqblur=0:vbitrate=%E_BR%:keyint=%E_MIK%:vqcomp=%E_VQ%
:vmax_b_frames=%E_MBF%:bidir_refine=%E_BFR%:vb_qfactor=1.00:vb_qoffset=0.0:vi_qfactor=1.00
:vi_qoffset=0.0:me_range=%E_RME%:preme=%E_PME%:dia=%E_DIA%:predia=%E_DIA%:mbd=%E_RDO%:precmp=%E_CMP%
:cmp=%E_CMP%:subcmp=%E_CMP%:mv0:last_pred=3:trell:cbp:dc=%E_DC%:psnr:aspect=%E_DAR%
:inter_matrix=%E_INTER%:intra_matrix=%E_INTRA%:p_mask=%E_PMSK%:vqmin=%E_MQ%:lmin=%E_MQ%:vqblur=0
:vrc_maxrate=%VBV_MBR%:vrc_buf_size=%VBV_MBS%:vrc_strategy=0 -of rawvideo -ffourcc MPG2

@pause

danpos
16th April 2006, 17:31
@Sagittaire

How does this profile differ from the other one posted for you at another forum ??? Just of curiosity ...

Cheers,

kevin23
21st April 2006, 02:13
@Sagittaire
Tried running this , get an error from mencoder " unknown suboption sc_factor. tried a different version of mencoder and it says Exiting <error parsing cmdline>

Using an Athlon XP 2000.

Now getting another error using MCbatch

Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 704 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (704x480 fourcc=3267706d [mpg2])
High quality encoding selected (non real time)!
Using constant qscale = 3.000000 (VBR)
Warning, QMAT_SHIFT is larger then 21, overflows possible
[mpeg2video @ 00A5A7D8]MPEG1/2 does not support 2997/125 fps
Could not open codec.
FATAL: Cannot initialize video driver.
VDecoder init failed :(
Cannot find codec matching selected -vo and video format 0x32315659.
Read DOCS/HTML/en/codecs.html!
==========================================================================


Strangely its working with one of my Xvid rips but same setting with another one it does not work and gives the above error.

Alrite all errors sorted out other than sc_factor=6 , have to remove this suboption.

Revgen
16th May 2006, 23:23
@echo off

@REM -----------------------------------------------------------------------------------------------
@REM
@REM MPEG2 Mencoder Profil
@REM
@REM -----------------------------------------------------------------------------------------------



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Output and Input files
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Input file name
set E_SRC=MPEG2.avs

@REM Output file name
set E_VID=MPEG2-HQ.m2v



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Rate control settings
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Set of bitrates
set E_BR=1800

@REM Set of max bitrates (use 9800 max for DVD compliant stream)
set VBV_MBR=9000

@REM Set of max buffer size (use 1835 max for DVD compliant stream)
set VBV_MBS=1835

@REM Set of ratio initial buffer occupency (0.9 is good value)
set VBV_IBO=0.9

@REM Set of first pass quantizer (2 is good value for high bitrate)
set E_IQ=3

@REM Set of min quantizer (1 is good value for high bitrate)
set E_MQ=2

@REM Set of quantizer variability [0.00;1.00] (0.75 is good value)
set E_VQ=0.75

@REM Set of inter quantizer masking [0.00;1.00] (0.00-0.50 is good interval)
set E_PMSK=0.00
IF "%E_MQ%" == "1" GOTO HIGH
set E_PMSK=0.50
:HIGH
set E_PMSK=%E_PMSK%



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> GOP structure
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Set of max interval KFrame (use 15 for DVD PAL and 18 for DVD NTSC)
set E_MIK=15

@REM Set of max BFrames [0;4] (use 2 max for DVD compliant stream)
set E_MBF=2

@REM Set of Adaptative BFrames [0;2] (desactived is 0, fast is 1 and slow is 2)
set E_ABF=2

@REM Set of Slow Adaptative BFrames Refine [0;10] (0 is full search, higher is faster)
set E_SBF=1



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Motion estimation settings
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Set of ME range [0;9999] (use 128 for DVD compliant stream)
set E_RME=128

@REM Set of Rate Distortion Optimisation [0;2] (2 is the best)
set E_RDO=2

@REM Set of diamond size [-99;6] (negatives values are adaptative diamond)
set E_DIA=1

@REM Set of comparison function for ME [0;2000] (0 is SAD, 1 is SSE, 2 is SADT, +256 for chroma ME)
set E_CMP=1

@REM Set of previous ME [0;2]
set E_PME=2

@REM Set of BFrame refinements [0;4] (Bframe Quality, 4 is best quality)
set E_BFR=4



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> VUI settings
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Display Aspect Ratio (4/3 or 16/9 for DVD compliant stream)
set E_DAR=4/3

@REM DC precision [8;10]
set E_DC=8

@REM Framerate (use 25 for PAL and 24000/1001 or 30000/1001 for NTSC)
set E_FPS=25

@REM Set intra matrix (use coef > 8 for DVD compliant stream with mencoder)
set E_INTRA=08,16,16,16,17,18,21,24,16,16,16,16,17,19,22,25,16,16,17,18,20,22,25,29,16,16,18,21,24,
27,31,36,17,17,20,24,30,35,41,47,18,19,22,27,35,44,54,65,21,22,25,31,41,54,70,88,24,25,29,36,47,65,
88,115

@REM Set inter matrix (use coef > 8 for DVD compliant stream with mencoder)
set E_INTER=16,16,16,16,17,18,21,24,16,16,16,16,17,19,22,25,16,16,17,18,20,22,25,29,16,16,18,21,24,
27,31,36,17,17,20,24,30,35,41,47,18,19,22,27,35,44,54,65,21,22,25,31,41,54,70,88,24,25,29,36,47,65,
88,115



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Mencoder CLI
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

ECHO.---------------------------------------------------------------
ECHO.First pass ...
ECHO.---------------------------------------------------------------
mencoder.exe -priority idle %E_SRC% -o NUL -ovc lavc -vf yuvcsp -ofps %E_FPS%
-lavcopts vcodec=mpeg2video:vpass=1:turbo:sc_factor=6:vqscale=%E_IQ%:keyint=%E_MIK%:vqcomp=%E_VQ%
:vmax_b_frames=%E_MBF%:vb_strategy=%E_ABF%:brd_scale=%E_SBF%:vb_qfactor=1.00:vb_qoffset=0.0
:vi_qfactor=1.00:vi_qoffset=0.0:me_range=%E_RME%:preme=%E_PME%:dia=1:predia=1:mbd=%E_RDO%:precmp=0
:cmp=0:subcmp=0:mv0:last_pred=0:dc=%E_DC%:psnr:aspect=%E_DAR%:inter_matrix=%E_INTER%
:intra_matrix=%E_INTRA%:p_mask=%E_PMSK%:vqmin=%E_MQ%:lmin=%E_MQ%:vqblur=0 -of rawvideo -ffourcc MPG2

@CLS

ECHO.---------------------------------------------------------------
ECHO.Second pass ...
ECHO.---------------------------------------------------------------
mencoder.exe -priority idle %E_SRC% -o NUL -ovc lavc -vf yuvcsp -ofps %E_FPS%
-lavcopts vcodec=mpeg2video:vpass=3:sc_factor=6:vbitrate=%E_BR%:keyint=%E_MIK%:vqcomp=%E_VQ%
:vmax_b_frames=%E_MBF%:vb_qfactor=1.00:vb_qoffset=0.0:vi_qfactor=1.00:vi_qoffset=0.0
:me_range=%E_RME%:preme=%E_PME%:dia=1:predia=1:mbd=%E_RDO%:precmp=0:cmp=0:subcmp=0:mv0:last_pred=0
:dc=%E_DC%:psnr:aspect=%E_DAR%:inter_matrix=%E_INTER%:intra_matrix=%E_INTRA%:p_mask=%E_PMSK%
:vqmin=%E_MQ%:lmin=%E_MQ%:vqblur=0:vrc_maxrate=%VBV_MBR%:vrc_buf_size=%VBV_MBS%:vrc_strategy=0
-of rawvideo -ffourcc MPG2

@CLS

ECHO.---------------------------------------------------------------
ECHO.Last pass ...
ECHO.---------------------------------------------------------------
mencoder.exe -priority idle %E_SRC% -o %E_VID% -ovc lavc -vf yuvcsp -ofps %E_FPS%
-lavcopts vcodec=mpeg2video:vpass=2:sc_factor=6:vqblur=0:vbitrate=%E_BR%:keyint=%E_MIK%:vqcomp=%E_VQ%
:vmax_b_frames=%E_MBF%:bidir_refine=%E_BFR%:vb_qfactor=1.00:vb_qoffset=0.0:vi_qfactor=1.00
:vi_qoffset=0.0:me_range=%E_RME%:preme=%E_PME%:dia=%E_DIA%:predia=%E_DIA%:mbd=%E_RDO%:precmp=%E_CMP%
:cmp=%E_CMP%:subcmp=%E_CMP%:mv0:last_pred=3:trell:cbp:dc=%E_DC%:psnr:aspect=%E_DAR%
:inter_matrix=%E_INTER%:intra_matrix=%E_INTRA%:p_mask=%E_PMSK%:vqmin=%E_MQ%:lmin=%E_MQ%:vqblur=0
:vrc_maxrate=%VBV_MBR%:vrc_buf_size=%VBV_MBS%:vrc_strategy=0 -of rawvideo -ffourcc MPG2

@pause


I tried the above script with the 2006.04.19 build of mencoder and used a 4500kbps bitrate and the file came out to 718MB. Is there something I'm doing wrong?

Here is my customized version:

@echo off

@REM -----------------------------------------------------------------------------------------------
@REM
@REM MPEG2 Mencoder Profil
@REM
@REM -----------------------------------------------------------------------------------------------



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Output and Input files
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Input file name
set E_SRC=J:\star\star.avs

@REM Output file name
set E_VID=J:\star\starmencoder.m2v



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Rate control settings
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Set of bitrates
set E_BR=4500

@REM Set of max bitrates (use 9800 max for DVD compliant stream)
set VBV_MBR=9800

@REM Set of max buffer size (use 1835 max for DVD compliant stream)
set VBV_MBS=1835

@REM Set of ratio initial buffer occupency (0.9 is good value)
set VBV_IBO=0.9

@REM Set of first pass quantizer (2 is good value for high bitrate)
set E_IQ=3

@REM Set of min quantizer (1 is good value for high bitrate)
set E_MQ=2

@REM Set of quantizer variability [0.00;1.00] (0.75 is good value)
set E_VQ=0.75

@REM Set of inter quantizer masking [0.00;1.00] (0.00-0.50 is good interval)
set E_PMSK=0.00
IF "%E_MQ%" == "1" GOTO HIGH
set E_PMSK=0.50
:HIGH
set E_PMSK=%E_PMSK%



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> GOP structure
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Set of max interval KFrame (use 15 for DVD PAL and 18 for DVD NTSC)
set E_MIK=18

@REM Set of max BFrames [0;4] (use 2 max for DVD compliant stream)
set E_MBF=2

@REM Set of Adaptative BFrames [0;2] (desactived is 0, fast is 1 and slow is 2)
set E_ABF=2

@REM Set of Slow Adaptative BFrames Refine [0;10] (0 is full search, higher is faster)
set E_SBF=1



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Motion estimation settings
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Set of ME range [0;9999] (use 128 for DVD compliant stream)
set E_RME=128

@REM Set of Rate Distortion Optimisation [0;2] (2 is the best)
set E_RDO=2

@REM Set of diamond size [-99;6] (negatives values are adaptative diamond)
set E_DIA=1

@REM Set of comparison function for ME [0;2000] (0 is SAD, 1 is SSE, 2 is SADT, +256 for chroma ME)
set E_CMP=1

@REM Set of previous ME [0;2]
set E_PME=2

@REM Set of BFrame refinements [0;4] (Bframe Quality, 4 is best quality)
set E_BFR=4



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> VUI settings
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@REM Display Aspect Ratio (4/3 or 16/9 for DVD compliant stream)
set E_DAR=16/9

@REM DC precision [8;10]
set E_DC=9

@REM Framerate (use 25 for PAL and 24000/1001 or 30000/1001 for NTSC)
set E_FPS=24000/1001

@REM Set intra matrix (use coef > 8 for DVD compliant stream with mencoder)
set E_INTRA=08,16,16,16,17,18,21,24,16,16,16,16,17,19,22,25,16,16,17,18,20,22,25,29,16,16,18,21,24,
27,31,36,17,17,20,24,30,35,41,47,18,19,22,27,35,44,54,65,21,22,25,31,41,54,70,88,24,25,29,36,47,65,
88,115

@REM Set inter matrix (use coef > 8 for DVD compliant stream with mencoder)
set E_INTER=16,16,16,16,17,18,21,24,16,16,16,16,17,19,22,25,16,16,17,18,20,22,25,29,16,16,18,21,24,
27,31,36,17,17,20,24,30,35,41,47,18,19,22,27,35,44,54,65,21,22,25,31,41,54,70,88,24,25,29,36,47,65,
88,115



@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@REM >> Mencoder CLI
@REM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

ECHO.---------------------------------------------------------------
ECHO.First pass ...
ECHO.---------------------------------------------------------------
mencoder.exe -priority idle %E_SRC% -o NUL -ovc lavc -vf yuvcsp -ofps %E_FPS%
-lavcopts vcodec=mpeg2video:vpass=1:turbo:sc_factor=6:vqscale=%E_IQ%:keyint=%E_MIK%:vqcomp=%E_VQ%
:vmax_b_frames=%E_MBF%:vb_strategy=%E_ABF%:brd_scale=%E_SBF%:vb_qfactor=1.00:vb_qoffset=0.0
:vi_qfactor=1.00:vi_qoffset=0.0:me_range=%E_RME%:preme=%E_PME%:dia=1:predia=1:mbd=%E_RDO%:precmp=0
:cmp=0:subcmp=0:mv0:last_pred=0:dc=%E_DC%:psnr:aspect=%E_DAR%:inter_matrix=%E_INTER%
:intra_matrix=%E_INTRA%:p_mask=%E_PMSK%:vqmin=%E_MQ%:lmin=%E_MQ%:vqblur=0 -of rawvideo -ffourcc MPG2

@CLS

ECHO.---------------------------------------------------------------
ECHO.Second pass ...
ECHO.---------------------------------------------------------------
mencoder.exe -priority idle %E_SRC% -o NUL -ovc lavc -vf yuvcsp -ofps %E_FPS%
-lavcopts vcodec=mpeg2video:vpass=3:sc_factor=6:vbitrate=%E_BR%:keyint=%E_MIK%:vqcomp=%E_VQ%
:vmax_b_frames=%E_MBF%:vb_qfactor=1.00:vb_qoffset=0.0:vi_qfactor=1.00:vi_qoffset=0.0
:me_range=%E_RME%:preme=%E_PME%:dia=1:predia=1:mbd=%E_RDO%:precmp=0:cmp=0:subcmp=0:mv0:last_pred=0
:dc=%E_DC%:psnr:aspect=%E_DAR%:inter_matrix=%E_INTER%:intra_matrix=%E_INTRA%:p_mask=%E_PMSK%
:vqmin=%E_MQ%:lmin=%E_MQ%:vqblur=0:vrc_maxrate=%VBV_MBR%:vrc_buf_size=%VBV_MBS%:vrc_strategy=0
-of rawvideo -ffourcc MPG2

@CLS

ECHO.---------------------------------------------------------------
ECHO.Last pass ...
ECHO.---------------------------------------------------------------
mencoder.exe -priority idle %E_SRC% -o %E_VID% -ovc lavc -vf yuvcsp -ofps %E_FPS%
-lavcopts vcodec=mpeg2video:vpass=2:sc_factor=6:vqblur=0:vbitrate=%E_BR%:keyint=%E_MIK%:vqcomp=%E_VQ%
:vmax_b_frames=%E_MBF%:bidir_refine=%E_BFR%:vb_qfactor=1.00:vb_qoffset=0.0:vi_qfactor=1.00
:vi_qoffset=0.0:me_range=%E_RME%:preme=%E_PME%:dia=%E_DIA%:predia=%E_DIA%:mbd=%E_RDO%:precmp=%E_CMP%
:cmp=%E_CMP%:subcmp=%E_CMP%:mv0:last_pred=3:trell:cbp:dc=%E_DC%:psnr:aspect=%E_DAR%
:inter_matrix=%E_INTER%:intra_matrix=%E_INTRA%:p_mask=%E_PMSK%:vqmin=%E_MQ%:lmin=%E_MQ%:vqblur=0
:vrc_maxrate=%VBV_MBR%:vrc_buf_size=%VBV_MBS%:vrc_strategy=0 -of rawvideo -ffourcc MPG2

@pause