digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   Codecs: Libavcodec progress thread (http://www.digitalfaq.com/archives/encode/14153-codecs-libavcodec-progress.html)

Dialhot 03-15-2006 04:32 PM

Quote:

Originally Posted by rds_correia
Ooops, wait a minute Gamma.
If Sagittaire's MPEG file reads a lot of errors on DVD Verifier but the demuxed M2V doesn't, then I would say that those errors were introduced by the authoring tool which doesn't make much sense...

Why not ? the verifier can check different things depending on the source type (muxed or elementary streams). And then, yes, that means that the muxer has a problem.

gamma 03-16-2006 12:46 AM

Quote:

Originally Posted by Dialhot
Quote:

Originally Posted by rds_correia
Ooops, wait a minute Gamma.
If Sagittaire's MPEG file reads a lot of errors on DVD Verifier but the demuxed M2V doesn't, then I would say that those errors were introduced by the authoring tool which doesn't make much sense...

Why not ? the verifier can check different things depending on the source type (muxed or elementary streams). And then, yes, that means that the muxer has a problem.

Indeed, that's why I posted in my earlier results only the elementary stream. It seems muxers produce various errors. I was very amazed that even commercial DVD's produces errors 8O. But that was an ILVU disc so maybe that's the problem (star wars 3).

Interesting would be: how does the muxer errors influence the mpeg compliancy?

On my todo list is a comparison of muxers, as in ifoedit, muxman, dvd lab pro, tmpg and spruce dvd maestro. But I'll need some time for that :D

Dialhot 03-16-2006 03:55 AM

Quote:

Originally Posted by gamma
Interesting would be: how does the muxer errors influence the mpeg compliancy?

IMHO there is no question like this. It has to be checked into the doc of the soft but for me the tool does not verify the same things when you give to it a muxed or an elementary stream.
In other word, checking the muxed vob gives you only the "muxing errors" while cheking the demuxed stream really give you the mpeg compliancy.

gamma 03-16-2006 09:50 AM

Quote:

Originally Posted by Dialhot
Quote:

Originally Posted by gamma
Interesting would be: how does the muxer errors influence the mpeg compliancy?

IMHO there is no question like this. It has to be checked into the doc of the soft but for me the tool does not verify the same things when you give to it a muxed or an elementary stream.
In other word, checking the muxed vob gives you only the "muxing errors" while cheking the demuxed stream really give you the mpeg compliancy.

:oops: I meant "DVD" instead of "MPEG". You're right, the muxer doesn't change the compliancy of the encoded file, but is responsible for the overall DVD compliancy.

When checking a muxed vob, the verifier does check muxer errors as well as mpeg errors. The total errors are the mpeg errors + the muxer errors + navigational errors + ....

Sagittaire 03-18-2006 11:14 AM

Quote:

Lavcodec uses a LINEAR Quantisation where TmpgEnc, CCE and others do use a NONLINEAR Quantisation.
I think that non linear quantisation is adaptative quantisation (I am not sure here ... perhaps not). Anyway Libacodec can use adaptive quantisation in two differents mode:

- RDO for each macroblock
- Masking for each macroblock (lumi, dark, spacial, temporal)

TMPGEnc use certainely something like spacial/temporal masking for Adaptative quantisation. AQ is certainely very usefull too to respect vbv limitation ...

Quote:

A Q of 2 in Lavcodec matches almost a Q of 4 in TmpgEnc, CCE etc. Keep in mind Im talking about human eyes subjective comparison.
Quote:

So a Quantizer of 4 in lavcodec results in a significant worse output than compared to a Quantizer of 4 when using TmpGenc, CCE etc.!
Well I use OSD in ffdshow and I see that vqscale=2 (only for MPEG2) done q=4, vqscale=3 done q=6 on OSD ... etc etc etc

two solutions:
- Mencoder MPEG2 is buggy and use only quantizer with X2 scaling
- Libavcodec decoder OSD is buggy

I make encoding with same setting (source, custom matrix, dc ...)
- Mencoder encoding vqscale=2 done 4406 Kbps and q4 for OSD
- TMPGEnc CQ78 encoding done 4692 Kbps and ~q4 for OSD
- TMPGEnc CQ100 encoding done exactly q1 for OSD

Conclusion: Mencoder MPEG2 is buggy and use only quantizer with X2 scaling. It is not a fatal bug but mencoder can't simply use impair quantizer. Perhaps volunteer limitation from libavcodec dev for better compatibility with actual libavcodec Rate Control.

Sagittaire 03-21-2006 06:40 PM

well try this:
http://oss.netfarm.it/mplayer-win32.php

be carefull :

- final bitrate must be always inferior to fast first pass at q6. Ik you want know compressibility Q6 make little compressibility test (5% is enougth with source=SelectRangeEvery(source, 300, 15) for example).

- this configuration is insame quality setting. Use CCIR601 space color for better compressibility. I use this profil only for very low bitrate with adaptative avs script.

Code:

@echo off

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



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

@REM Input file name
set E_SRC=Encodage-HD.avs

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



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

@REM Set of bitrates
set E_BR=4000

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

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

@REM Set of first pass quantizer (3 is good initial value)
set E_IQ=3

@REM Set of min quantizer (2 is good value)
set E_MQ=2

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



@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=-6

@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=257

@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=8

@REM Set intra matrix (use coef > 16 for DVD compliant stream with mencoder)
set E_INTRA=8,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 > 16 for DVD compliant stream with mencoder)
set E_INTER=16,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



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

mencoder.exe %E_SRC% -o %E_VID% -ovc lavc -noskip -vf yuvcsp -lavcopts vcodec=mpeg2video:vpass=1:turbo:vqmin=%E_MQ%:lmin=2:sc_factor=6:vqblur=0:vqscale=%E_IQ%:vrc_maxrate=%E_MBR%:vrc_buf_size=%E_MBS%: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=%E_DIA%:predia=%E_DIA%:mbd=%E_RDO%:precmp=%E_CMP%:cmp=%E_CMP%:subcmp=%E_CMP%:mv0:last_pred=0:trell:cbp:dc=%E_DC%:psnr:aspect=%E_DAR%:inter_matrix=%E_INTER%:intra_matrix=%E_INTRA%:p_mask=0.5 -of rawvideo -ffourcc MPG2

mencoder.exe %E_SRC% -o %E_VID% -ovc lavc -noskip -vf yuvcsp -lavcopts vcodec=mpeg2video:vpass=3:vqmin=%E_MQ%:lmin=2:sc_factor=6:vqblur=0:vbitrate=%E_BR%:vrc_maxrate=%E_MBR%:vrc_buf_size=%E_MBS%: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=%E_DIA%:predia=%E_DIA%:mbd=%E_RDO%:precmp=%E_CMP%:cmp=%E_CMP%:subcmp=%E_CMP%:mv0:last_pred=0:trell:cbp:dc=%E_DC%:psnr:aspect=%E_DAR%:inter_matrix=%E_INTER%:intra_matrix=%E_INTRA%:p_mask=0.5 -of rawvideo -ffourcc MPG2

mencoder.exe %E_SRC% -o %E_VID% -ovc lavc -noskip -vf yuvcsp -lavcopts vcodec=mpeg2video:vpass=3:vqmin=%E_MQ%:lmin=2:sc_factor=6:vqblur=0:vbitrate=%E_BR%:vrc_maxrate=%E_MBR%:vrc_buf_size=%E_MBS%: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=0.5 -of rawvideo -ffourcc MPG2


pause


incredible 03-22-2006 03:51 AM

My suggestion for easier File input handling .....

So just drag'n drop the source .avs to this bat and an encoding using the source's filename but with a suffix of .m2v will be the result.

Code:

@echo off

CLS
SET WORK=%~dp0

IF NOT EXIST "%WORK%mencoder.exe" (
        ECHO.---------------------------------------------------------
        ECHO.mencoder.exe doesn't exist in the same folder
        ECHO.where this bat file has been copied to.
        ECHO.
        ECHO.Get the official mplayer/mencoder package
        ECHO.at http://oss.netfarm.it/mplayer-win32.php
        ECHO.and put the bat file into the same folder folder.
  ECHO.where mencoder.exe exists.
        ECHO.---------------------------------------------------------
        ECHO.
        PAUSE
        GOTO :END
)

IF NOT EXIST "%~1" (
        ECHO.Can't detect the source.
        PAUSE
        GOTO :END
)


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

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

@REM Set of bitrates
set E_BR=4000

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

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

@REM Set of first pass quantizer (3 is good initial value)
set E_IQ=3

@REM Set of min quantizer (2 is good value)
set E_MQ=2

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



@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=-6

@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=257

@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=8

@REM Set intra matrix (use coef > 16 for DVD compliant stream with mencoder)
set E_INTRA=8,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 > 16 for DVD compliant stream with mencoder)
set E_INTER=16,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



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

ECHO.---------------------------------------------------------------
ECHO.Binary: %WORK%mencoder.exe
ECHO.---------------------------------------------------------------
ECHO.Source: %~1
ECHO.Target: %~dpn1.m2v
ECHO.---------------------------------------------------------------
ECHO.
ECHO.Conversion to raw mpeg2 starts ...
ECHO.
ECHO.---------------------------------------------------------------
ECHO.First pass ...
ECHO.---------------------------------------------------------------
ECHO.
"%WORK%mencoder.exe" %~1 -o %~dpn1.m2v -ovc lavc -noskip -vf yuvcsp -lavcopts vcodec=mpeg2video:vpass=1:turbo:vqmin=%E_MQ%:lmin=2:sc_factor=6:vqblur=0:vqscale=%E_IQ%:vrc_maxrate=%E_MBR%:vrc_buf_size=%E_MBS%: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=%E_DIA%:predia=%E_DIA%:mbd=%E_RDO%:precmp=%E_CMP%:cmp=%E_CMP%:subcmp=%E_CMP%:mv0:last_pred=0:trell:cbp:dc=%E_DC%:psnr:aspect=%E_DAR%:inter_matrix=%E_INTER%:intra_matrix=%E_INTRA%:p_mask=0.5 -of rawvideo -ffourcc MPG2
ECHO.
ECHO.---------------------------------------------------------------
ECHO.Second pass ...
ECHO.---------------------------------------------------------------
ECHO.
"%WORK%mencoder.exe" %~1 -o %~dpn1.m2v -ovc lavc -noskip -vf yuvcsp -lavcopts vcodec=mpeg2video:vpass=3:vqmin=%E_MQ%:lmin=2:sc_factor=6:vqblur=0:vbitrate=%E_BR%:vrc_maxrate=%E_MBR%:vrc_buf_size=%E_MBS%: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=%E_DIA%:predia=%E_DIA%:mbd=%E_RDO%:precmp=%E_CMP%:cmp=%E_CMP%:subcmp=%E_CMP%:mv0:last_pred=0:trell:cbp:dc=%E_DC%:psnr:aspect=%E_DAR%:inter_matrix=%E_INTER%:intra_matrix=%E_INTRA%:p_mask=0.5 -of rawvideo -ffourcc MPG2
ECHO.
ECHO.---------------------------------------------------------------
ECHO.Third pass ...
ECHO.---------------------------------------------------------------
ECHO.
"%WORK%mencoder.exe" %~1 -o %~dpn1.m2v -ovc lavc -noskip -vf yuvcsp -lavcopts vcodec=mpeg2video:vpass=3:vqmin=%E_MQ%:lmin=2:sc_factor=6:vqblur=0:vbitrate=%E_BR%:vrc_maxrate=%E_MBR%:vrc_buf_size=%E_MBS%: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=0.5 -of rawvideo -ffourcc MPG2

ECHO.
ECHO.mencoderERRORLEVEL=%ERRORLEVEL%
ECHO.

pause

:END
SET WORK=


Dialhot 03-22-2006 03:57 AM

Quote:

Originally Posted by Sagittaire
I use this profil only for very low bitrate with adaptative avs script.

I just want to be sure. The bitrate is given by what parameter ?
Isn't it this one :
Quote:

@REM Set of bitrates
set E_BR=4000
IF yes, 4000 us not really what I call low bitrate.
What (range) value do you generally use ?

Other question : is it a 3-pass encoding ?

@Inc
Thanks for your trick.

incredible 03-22-2006 04:10 AM

@Phil

Yes it seems so, if I understood correctly, that given 3pass approach above avoids ratecontrol issues/spikes ?

Dialhot 03-22-2006 04:27 AM

Quote:

Originally Posted by incredible
@Phil

Yes it seems so, if I understood correctly, that given 3pass approach above avoids ratecontrol issues/spikes ?

And enhance quality as the third pass introduces the "adaptative B-frame" feature. For testing purpose I don't mind doing 3-pass, just "to see".

I have a question more : in all passes there is the "pnsr" parameter. Is it for computing metrics while encoding ?
(I'm sure I should read a fucking manual... :))

incredible 03-22-2006 05:30 AM

It would really be interesting if also you could do a testing. Reports from diff. users always make more sense (not beeing generylly in doubt of you Sagittaire ;) you know what I mean).
I havn't (had) that much time for backups and testings the last weeks as I focussed my eyes on c/c++ understanding . :expert:
:lol:

Sagittaire 03-22-2006 03:31 PM

Quote:

I just want to be sure. The bitrate is given by what parameter ?
- by first fast pass at Q6 : final bitrate must be always inferior
- by compressibility test with modified source avs script
source=SelectRangeEvery(source, 300, 15) is 5% test
source=SelectRangeEvery(source, 150, 15) is 10% test


Quote:

IF yes, 4000 us not really what I call low bitrate.
What (range) value do you generally use ?
well 4000 is for very complexe source. I test these particulars sources only for profil validation.


Quote:

And enhance quality as the third pass introduces the "adaptative B-frame" feature.
First adaptative bframe is DVD compliant (CCE use adapt BF but not TMPGEnc). Second it's better for quality. Two mode are possible with libavcodec : fast adaptative based on simple motion level and full (slow) search level.


Quote:

Other question : is it a 3-pass encoding ?
3 pass done better quality and no underflow problem if you respect bitrate limitation (lower than Q6 constant quant)

see this example:

- first pass is fast Q6 pass : done high number underflow and 4575 Kbps
(you must use less than 4575 Kbps for final bitrate here)
- second pass done little number underflow with 4009 Kbps
- third pass done no underflow with 4004 Kbps

Code:

MEncoder Sherpya-MinGW-20060312-4.1.0 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Sempron/Athlon MP/XP Thoroughbred; Duron Applebred (Family: 6,
 Stepping: 1)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx

success: format: 0  data: 0x0 - 0x16d
AVS file format detected.
VIDEO:  [YV12]  720x576  12bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:38  fourcc:0x32315659  size:720x576  fps:25.00  ftime:=0.0400
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [yuvcsp]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (720x576 fourcc=3267706d [mpg2])
High quality encoding selected (non real time)!
Using constant qscale = 3.000000 (VBR)
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
==========================================================================
Forcing output fourcc to 3247504d [MPG2]
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
[mpeg2video @ 00B6C27C]rc buffer underflow 7min  34mb  A-V:0.000 [2229:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 7min  36mb  A-V:0.000 [2329:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 7min  37mb  A-V:0.000 [2388:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 7min  38mb  A-V:0.000 [2435:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 7min  39mb  A-V:0.000 [2490:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 7min  41mb  A-V:0.000 [2578:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  38mb  A-V:0.000 [2665:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  39mb  A-V:0.000 [2748:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  42mb  A-V:0.000 [2884:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  43mb  A-V:0.000 [2960:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  45mb  A-V:0.000 [3039:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  47mb  A-V:0.000 [3114:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  49mb  A-V:0.000 [3189:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  50mb  A-V:0.000 [3274:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  52mb  A-V:0.000 [3358:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  53mb  A-V:0.000 [3405:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 7min  54mb  A-V:0.000 [3456:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 7min  55mb  A-V:0.000 [3509:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 7min  56mb  A-V:0.000 [3563:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  51mb  A-V:0.000 [3616:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  52mb  A-V:0.000 [3651:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  52mb  A-V:0.000 [3671:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  54mb  A-V:0.000 [3754:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  54mb  A-V:0.000 [3775:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  55mb  A-V:0.000 [3812:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  56mb  A-V:0.000 [3832:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  56mb  A-V:0.000 [3871:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  57mb  A-V:0.000 [3893:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  58mb  A-V:0.000 [3931:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  58mb  A-V:0.000 [3953:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  59mb  A-V:0.000 [3991:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  59mb  A-V:0.000 [4013:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  60mb  A-V:0.000 [4051:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  61mb  A-V:0.000 [4073:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  62mb  A-V:0.000 [4110:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  62mb  A-V:0.000 [4132:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  64mb  A-V:0.000 [4215:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  64mb  A-V:0.000 [4237:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  65mb  A-V:0.000 [4274:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  66mb  A-V:0.000 [4296:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  66mb  A-V:0.000 [4334:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  67mb  A-V:0.000 [4357:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  68mb  A-V:0.000 [4399:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  68mb  A-V:0.000 [4425:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 7min  70mb  A-V:0.000 [4514:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 7min  71mb  A-V:0.000 [4567:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  68mb  A-V:0.000 [4786:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  69mb  A-V:0.000 [4859:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  70mb  A-V:0.000 [4887:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  71mb  A-V:0.000 [4937:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  71mb  A-V:0.000 [4962:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  72mb  A-V:0.000 [4983:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  72mb  A-V:0.000 [4998:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  73mb  A-V:0.000 [5018:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  73mb  A-V:0.000 [5039:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  74mb  A-V:0.000 [5063:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  74mb  A-V:0.000 [5080:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  75mb  A-V:0.000 [5093:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  81mb  A-V:0.000 [5265:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 3min  62mb  A-V:0.000 [4344:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 3min  63mb  A-V:0.000 [4355:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 3min  63mb  A-V:0.000 [4363:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 3min  63mb  A-V:0.000 [4371:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 2min  64mb  A-V:0.000 [4448:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 2min  64mb  A-V:0.000 [4456:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 1min  64mb  A-V:0.000 [4469:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 1min  64mb  A-V:0.000 [4473:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 1min  64mb  A-V:0.000 [4483:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 0min  64mb  A-V:0.000 [4487:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 0min  64mb  A-V:0.000 [4496:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 0min  64mb  A-V:0.000 [4499:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 0min  64mb  A-V:0.000 [4501:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 0min  64mb  A-V:0.000 [4503:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 0min  65mb  A-V:0.000 [4539:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 0min  65mb  A-V:0.000 [4545:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 0min  65mb  A-V:0.000 [4548:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 0min  65mb  A-V:0.000 [4554:0]
Pos: 120.0s  3002f (100%)  7.03fps Trem:  0min  65mb  A-V:0.000 [4579:0]
Flushing video frames

Video stream: 4576.588 kbit/s  (572073 B/s)  size: 68694585 bytes  120.080 secs  3002 fram
es
PSNR: Y:44.07, Cb:48.99, Cr:47.82, All:45.09





MEncoder Sherpya-MinGW-20060312-4.1.0 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Sempron/Athlon MP/XP Thoroughbred; Duron Applebred (Family: 6,
 Stepping: 1)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx

success: format: 0  data: 0x0 - 0x16d
AVS file format detected.
VIDEO:  [YV12]  720x576  12bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:38  fourcc:0x32315659  size:720x576  fps:25.00  ftime:=0.0400
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [yuvcsp]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (720x576 fourcc=3267706d [mpg2])
High quality encoding selected (non real time)!
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
==========================================================================
Forcing output fourcc to 3247504d [MPG2]
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  60mb  A-V:0.000 [4102:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  60mb  A-V:0.000 [4120:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 6min  61mb  A-V:0.000 [4135:0]
[mpeg2video @ 00B6C27C]rc buffer underflow 3min  55mb  A-V:0.000 [3834:0]
Pos: 120.0s  3002f (100%)  6.24fps Trem:  0min  57mb  A-V:0.000 [4012:0]
Flushing video frames

Video stream: 4009.496 kbit/s  (501187 B/s)  size: 60182542 bytes  120.080 secs  3002 fram
es
PSNR: Y:43.46, Cb:48.27, Cr:47.15, All:44.47





MEncoder Sherpya-MinGW-20060312-4.1.0 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Sempron/Athlon MP/XP Thoroughbred; Duron Applebred (Family: 6,
 Stepping: 1)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx

success: format: 0  data: 0x0 - 0x16d
AVS file format detected.
VIDEO:  [YV12]  720x576  12bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:38  fourcc:0x32315659  size:720x576  fps:25.00  ftime:=0.0400
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [yuvcsp]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (720x576 fourcc=3267706d [mpg2])
High quality encoding selected (non real time)!
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
==========================================================================
Forcing output fourcc to 3247504d [MPG2]
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
Pos: 120.0s  3002f (100%)  5.17fps Trem:  0min  57mb  A-V:0.000 [4007:0]
Flushing video frames

Video stream: 4004.855 kbit/s  (500606 B/s)  size: 60112869 bytes  120.080 secs  3002 fram
es
PSNR: Y:43.48, Cb:48.18, Cr:47.09, All:44.48


danpos 03-22-2006 04:39 PM

Sagittaire
 
@Sagittaire

I've tested Inc's modified batch file out with a smal clip and I've got this error:

Quote:

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)
[mpeg2video @ 00B6C27C]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!
================================================== ========================

Exiting...
I don't understand this because 2997/125 fps = 23.976 fps which is a standard framerate for MPEG2!!

Any help is appreciated.

TIA,

fabrice 03-24-2006 12:04 AM

Hi,

@Danpos: this is a daily build of mencoder, so just try to download a new daily version, to check if it has been fixed.

Speaking about that: can't we use a more stable version to play with mencoder? Because this way, everybody will be playing with a different version....

3 comment about my very first tests:
- Shouldn't be the vpass value 2 in the second encoding line? Or it doesn't matter?
- Looking at a 5% samples, comparing HC and mencoder, the image looks better with mencoder (I'm not speaking about SSIM value! :-) ). It looks, hmmm, cleaner?! And I checked mencoder against HC using SSIM, and on the frame where mencoder get real lower values than HC, the image looks like cleaned (something like a temporal cleaner). It's during a fast changing scene, so you can't see it, but HC is closer to the original, even if the original is of poor quality. I could post pictures, if you want..
- It's damned slow: each encoding pass gets 6fps (so it last more or less 4 times the length of the movie), so with 3 pass, for a 1h30 movie, it will last 18h! 8O . No way to speed up the thing a bit?

After encoding a full movie, I'll check the movie, burning a DVD-RW...


salu2
Fabrice

Dialhot 03-24-2006 03:37 AM

Quote:

Originally Posted by fabrice
No way to speed up the thing a bit?

That's why I asked the purpose of the "pnsr" filter in the command line but did not receive any answer. If the purpose is just to compute metrics while encoding, it does nothing but slowing the process. But I don't know if mencoder needs these info to enhance the detail.

Nevertheless I hope to find a couple of hour this we to test a little all that.

rds_correia 03-24-2006 03:57 AM

Oh my, oh my...
Here we go again testing mencoder :P.
Count me in guys.
But just to make one thing straight: if 3 passes is the only way to correct mencoder's bugs and if it takes ~18 hours to encode a full movie, then I don't think I'll ever start using mencoder regularly.
And on a side note, I agree with fabrice: we should pick a stable and full featured build for our tests.
Otherwise we'll end up using different releases and the results can be veeery different ;).
Andrej, where are you? :lol:
Build us a mencoder.exe for our tests, will you? :)
Cheers

incredible 03-24-2006 06:16 AM

Quote:

Originally Posted by Fabrice
I could post pictures, if you want..

Yes please ... pictures do say much more than words.
Better: t would be very nice if we would upload results using an approx. 20sec clip for obtaining a "mas o menos" impression on a moving example.
Use www.mytempdir.com or www.rapidshare.com.

Related to the vpass=3 Line:
http://www.kvcd.net/forum/viewtopic.php?p=122355#122355

Quote:

if 3 passes is the only way to correct mencoder's bugs and if it takes ~18 hours to encode a full movie, then I don't think I'll ever start using mencoder regularly.
Thats exactly the point, so someone has to make the decision for himself if the result worth it.

incredible 03-24-2006 06:26 AM

Rui, Sagittaire already gave that link for precompiled binaries ;) :
http://oss.netfarm.it/mplayer-win32.php

That page I also visit to update the daily Libs compiles for my MinGW install.

scroll down to the section "[Precompiled Mencoder binaries - XviD 1.1.0 - x264 svn]".
There you can download K7 or P3 or P4 optimized binaries. Actual build is from Mar 23, 2006 .... these builds are updated almost daily.

BUT! From the ./configure shown further below I do see that --enable-largefiles has NOT been set. So if you go in it using a 1piece big VOB > 2GB you could get into trouble. Avs input should not be a problem as bitstream frameserving is a diff. thing compared to filehandling.

rds_correia 03-24-2006 07:22 AM

Quote:

Originally Posted by incredible
Rui, Sagittaire already gave that link for precompiled binaries ;) :
http://oss.netfarm.it/mplayer-win32.php
That page I also visit to update the daily Libs compiles for my MinGW install.
scroll down to the section "[Precompiled Mencoder binaries - XviD 1.1.0 - x264 svn]".
There you can download K7 or P3 or P4 optimized binaries. Actual build is from Mar 23, 2006 .... these builds are updated almost daily.

Fair enough :).
But we should pick a build, let's say from May 20th, everybody should have to use that one for the test runs.

Quote:

BUT! From the ./configure shown further below I do see that --enable-largefiles has NOT been set. So if you go in it using a 1piece big VOB > 2GB you could get into trouble. Avs input should not be a problem as bitstream frameserving is a diff. thing compared to filehandling.
See? That's why I was calling you. :lol:
But for the tests we should find a small 30 seconds clip that would be submitted in mytempdir and we should all work on such a clip.
BTW, Karl has a nice movie he always uses for his tests.
That's Red Planet.
I wonder if he has a small clip like the one we're needing?
Kaaaaarl?? :lol:

Sagittaire 03-24-2006 07:24 AM

Quote:

I don't understand this because 2997/125 fps = 23.976 fps which is a standard framerate for MPEG2!!
add −ofps 24000/1001 or −ofps 30000/1001 option

I test only PAL progressive source but it's possible to make interlaced encoding too (from lavc documentation ... but I don't test that)


Quote:

- Shouldn't be the vpass value 2 in the second encoding line? Or it doesn't matter?
vpass1 : make stat file with quant mode or bitrate mode
vpass2: make encoding with first pass stat file
vpass3: make encoding N with N-1 pass stat file. stat file is updated.


Quote:

Looking at a 5% samples, comparing HC and mencoder, the image looks better with mencoder (I'm not speaking about SSIM value! ). It looks, hmmm, cleaner?! And I checked mencoder against HC using SSIM, and on the frame where mencoder get real lower values than HC, the image looks like cleaned (something like a temporal cleaner). It's during a fast changing scene, so you can't see it, but HC is closer to the original, even if the original is of poor quality. I could post pictures, if you want..
be carefull space color for my profil is not complete YV12 but CCIR 601 space color. If you want make visual/metric comparison use same space color for all encoder:
- Use "limiter" in your avs script
- desactive "-vf yuvcsp" in mencoder CLI

CCIR 601 done softer pictures but compressibilily is better and quality for low bitrate is better (like as you see). CCE and TMPGEnc can use CCIR 601 space color too ...

Actually Libavcodec done better result than HC, TMPGEnc or CCE for metric ...


Quote:

I have a question more : in all passes there is the "pnsr" parameter. Is it for computing metrics while encoding ?
Well, psnr computation don' use high CPU ressource. I use actually psnr computation for my personnal quality evaluation of internal mencoder video filter (average quantizer gain, average metric gain ... etc etc). desactive psnr if you want ...


Quote:

No way to speed up the thing a bit?
like I say my profil is insame quality profil.

You can use another ME setting if you want like:
- desactived RDO
- Trelli
- lower diamond size
- SAD for cmp
- no chroma search for cmp
- fast or no adaptative bframe

... etc etc etc

incredible 03-24-2006 08:02 AM

Quote:

- Use "limiter" in your avs script
- desactive "-vf yuvcsp" in mencoder CLI
I did that anyway all the time in case of Mencoder as its much more faster than Mencoders internal engine and ..... I didnt test IF Libavcodec just "crops" the lumarange from 0-255 to 16-235 or if it SCALES the range from 0-255 to 16-235 which affects the image in a sginificant way as the lumarage would be compressed.

Quote:

CCE and TMPGEnc can use CCIR 601 space color too
CCE and TmpgEnc do it by default! "Output YUV as CCIR instaed of full .. bla bla bla".

TmpgEnc does it in a significant diff. way compared to libavcodec or CCE.
TmgEnc does SCALE the 16-235 incoming Luma based YUV stream to full 0-255 rgb24 and rescales it back to 16-235 again when doing the encoding. Thats why a "limiter()" in case of a TmpgEnc usage is nonsense, that was also often stated by DialHot.

CCE Uses FORCED YUY2 input, so a YV12 one has to be conderted before (via script or by the YV12 supporting systemcodec like XVID).

So in this case Mencoder/Libavcodec is the only one which doesnt touch the Colorspace as it will be kept as YV12 in the whole progress.
So a simple crop by using limiter is perfect in case of mencoder/libavcodec.


Quote:

You can use another ME setting if you want like:
- desactived RDO
- Trelli
- lower diamond size
- SAD for cmp
- no chroma search for cmp
- fast or no adaptative bframe
Ok, but then the advantage of Mencoder will be blown away compared to HC, CCE etc. So thats a wrong approach.

Now we are at a state when using your line above that the Quality is a touch better, but the needed Time is decreased from almost 50fps(CCE) to 7fps (Mencoder). And that has to be taken into account if its worth it for the individual purpose.

Dialhot 03-24-2006 08:20 AM

Quote:

Originally Posted by incredible
Ok, but then the advantage of Mencoder will be blown away compared to HC, CCE etc. So thats a wrong approach.

Don't forget that in a first approach mencoder has to be tested (again) for its rate control. So you can remove all filters that are here just to enhance quality.

WHEN mencoder will go trustly between the white lines concerning the bitrates, then it will be time to look for the quality of the result it can output. But this is an other question.

The question for sagittaire is : among all the settings you suggested to remove to speed up the encoding, are you positive that none of them will modify the compliancy of mencoder concerning bitrate control ? Else, we should keep the lines as they are for the moment.

I think that we can at least change safely the diamond size and the function that cmp uses.

Note: My opinion is still that all this is just lost of time as RC module never changed in mencoder sources... but why not.

incredible 03-24-2006 10:12 AM

Fully agree!

Sagittaire 03-24-2006 11:49 AM

Quote:

The question for sagittaire is : among all the settings you suggested to remove to speed up the encoding, are you positive that none of them will modify the compliancy of mencoder concerning bitrate control ? Else, we should keep the lines as they are for the moment.
IMO all ME speed improvement are good ...


Quote:

My opinion is still that all this is just lost of time as RC module never changed in mencoder sources... but why not.
I read your old Mencoder sub-forum: there was 2 problems:
- Motion Vector Range problem : solved with me-range setting
- Rate Control with underflowing problem : IMO multipass can partialy solved this problem. At this time Mencoder can't make Superbit DVD but IMO can make high quality encoding in low/medium bitrate scenario like KDVD profil

incredible 03-24-2006 12:37 PM

What about the minbitrate argument in the Commandline? I know it isnt supported officialy, but when I "tested" it, it made Mencoder the ONLY encoder which kept the minbitrate at the setted value! Even CCE when setting minrate to i.E. 500kbit often underruns that value.

In my tests I almost never had buffer underflows or bitrate underruns and IF then in a same way CCE does it. The only problem where the Spikes, ok for my SAP no Problem, but we are talking about official DVD compilancy in here.
And even in resulting streams where min and max where kept, sometimes it was reported that within that safe range also here the ratecontrol sometimes got messed up.

I had a look at the Q curve in BV viewer and imho sometimes when using common Comandlines the curve wasnt optimal, means not very logical.

My personal test would be: IF an encoder recognises a very low lit and very low complex scene, he shouldnt keep the Q at straight 3 or 4 for example, but he should lower the Q instead, so you will end up in a very good quality low light scene (Try to encode Underwater Scenes like you can see in Titanic or Das Boot - here youll see what I mean.
BTW: also CCE and TmpgEnc dont handle that optimal.
Is that a subject for Lumimasking?

DID you have a look at Freenc? Seems to be more easy for users as parameters easely can be tweaked in the ini file. AFAIK also MeRange is adjustable.
I dont know which build of Libavcodec it includes but it should be no Problem to recompile it using DevC++ as Vmesquita made it open source.
But that investigation of time will only be done if the "main" subject above related to DVD compilancy above will be proofed as positive.

fabrice 03-24-2006 01:03 PM

Hi,

I tried to encode a full movie (the 18 hours encoding one) with a average bitrate of 2005 (at 704x576), and according to rempeg2, the absolute max bitrate is 8006 (I set it to 8000). According to mpeg validator, the peak on 1 sec is 7042.

So it seems that on this movie (four fantastics), it's ok. mpeg validator is giving me some errors, that I don't get with hc:
Code:

*Sequence_end_code NOT FOUND, in Stream E0!!
*Top Field First = No
*DCT Type = Frame
*First GOP Closed = No

I'll make more test this we.

Salu2
Fabrice

incredible 03-24-2006 01:18 PM

The seq end code = nomen est omen.
The stream in regular gots a flag at the end where other apps. will recognise that this stream gots its end.
Imho this should be no problem, its more difficult if you for example do stream Episodes using DVB and every stream gots its seq end code. Do "merge" these ones without using an option for "remove seq end code" like using the DOS copy /b command ... and every demuxer could STOP at that "still existing" seq end code at the half of the merged mpeg2 stream.

I had that issue a long time ago when I streamed via DVB two episodes.
I treated them each using ProjectX and simply "merged" them after that for later cutting purposes. BUT when I wanted to "demux" again that full resulting mpg to get the separate m2v and Ac3 ... even ProjectX stopepd demuxing after approx. the half of the merged mpg ;)


Do look in the mencoder docu if theres a special argument for applying that seq.end.code.

Sagittaire 03-24-2006 04:30 PM

I will try to update profil:
- VCD, SVCD, DVD profil
- PAL, NTSC profil
- progressive, telecine, interlaced profil
- Fast, normal, high and insame profil

Stream bug and quality optimisation
- Little bug issue (no fatal bug I think) like end sequence, field, first GOP
- Very important end credit option for low bitrate encoding.

incredible 03-25-2006 04:54 AM

@ All
If you do end up with a choma swapped result

do modify the -vf comand of each! pass of the mencoder lines below from

-vf yuvcsp

to

-vf yuvcsp,swapuv

incredible 03-25-2006 06:18 AM

First try and ..... same problem as before:

I used a 5% sliced sample of a typical averaged movie including action, low ligth scenes, bright light scenes, explosions, smooth surfaces, action and calm passages.

Using the exact bat file from Sagittaire.

Each pass of mencoder ran at 17fps where CCE (also 2pass) did ist job at 50fps.

First the Log .... as you can see in the third pass still buffer underruns did occur.

Quote:

---------------------------------------------------------------
Binary: H:\sw3 reencode\mencoder.exe
---------------------------------------------------------------
Source: H:\sw3 reencode\encodertest.avs
Target: H:\sw3 reencode\encodertest.m2v
---------------------------------------------------------------

Conversion to raw mpeg2 starts ...

---------------------------------------------------------------
First pass ...
---------------------------------------------------------------

MEncoder dev-CVS-060321-16:16-4.0.2 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Sempron/Athlon MP/XP Thoroughbred; Duron Applebred (Family: 6, Stepping: 1)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

91 audio & 206 video codecs
success: format: 0 data: 0x0 - 0x523
AVS file format detected.
VIDEO: [YV12] 720x576 12bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:38 fourcc:0x32315659 size:720x576 fps:25.00 ftime:=0.0400
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [swapuv]
================================================== ========================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (720x576 fourcc=3267706d [mpg2])
High quality encoding selected (non real time)!
Using constant qscale = 3.000000 (VBR)
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
================================================== ========================
Forcing output fourcc to 3247504d [MPG2]
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
Pos: 388.0s 9701f ( 0%) 14.81fps Trem: 0min 0mb A-V:0.000 [2712:0]
Flushing video frames

Video stream: 2711.770 kbit/s (338971 B/s) size: 131534382 bytes 388.040 secs 9701 frames
PSNR: Y:45.47, Cb:47.22, Cr:48.03, All:46.07

---------------------------------------------------------------
Second pass ...
---------------------------------------------------------------

MEncoder dev-CVS-060321-16:16-4.0.2 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Sempron/Athlon MP/XP Thoroughbred; Duron Applebred (Family: 6, Stepping: 1)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

91 audio & 206 video codecs
success: format: 0 data: 0x0 - 0x523
AVS file format detected.
VIDEO: [YV12] 720x576 12bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:38 fourcc:0x32315659 size:720x576 fps:25.00 ftime:=0.0400
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [swapuv]
================================================== ========================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (720x576 fourcc=3267706d [mpg2])
High quality encoding selected (non real time)!
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
================================================== ========================
Forcing output fourcc to 3247504d [MPG2]
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
Pos: 388.0s 9701f ( 0%) 13.06fps Trem: 0min 0mb A-V:0.000 [3430:0]
Flushing video frames

Video stream: 3430.277 kbit/s (428784 B/s) size: 166385592 bytes 388.040 secs 9701 frames
PSNR: Y:46.88, Cb:48.10, Cr:48.84, All:47.34

---------------------------------------------------------------
Third pass ...
---------------------------------------------------------------

MEncoder dev-CVS-060321-16:16-4.0.2 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Sempron/Athlon MP/XP Thoroughbred; Duron Applebred (Family: 6, Stepping: 1)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

91 audio & 206 video codecs
success: format: 0 data: 0x0 - 0x523
AVS file format detected.
VIDEO: [YV12] 720x576 12bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:38 fourcc:0x32315659 size:720x576 fps:25.00 ftime:=0.0400
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [swapuv]
================================================== ========================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (720x576 fourcc=3267706d [mpg2])
High quality encoding selected (non real time)!
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
================================================== ========================
Forcing output fourcc to 3247504d [MPG2]
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3476:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3477:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3478:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3499:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3501:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3503:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3505:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3506:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3508:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3510:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3523:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3526:0]
[mpeg2video @ 00A6ED88]rc buffer underflow 0min 0mb A-V:0.000 [3528:0]
Pos: 388.0s 9701f ( 0%) 9.56fps Trem: 0min 0mb A-V:0.000 [3651:0]

Flushing video frames

Video stream: 3650.878 kbit/s (456359 B/s) size: 177085839 bytes 388.040 secs 9701 frames
PSNR: Y:47.15, Cb:48.29, Cr:49.02, All:47.60

mencoderERRORLEVEL=0

Then .... I reconised that even if the avgbitrate in mencoder was set at 4000kbit, the result ended up in 3556kbit in average.

AND! Even when using a max bitrate of 9000kbit we .... got .... SPIKEs up to almost 9900kbit.

See the right window of mencoders Bitrateviewer output:

http://www.digitalfaq.com/archives/i.../2006/03/1.gif

And now why is that final encoding that undersized? Very easy, we did set a wanted avg bitrate of 4000 and ended up in 3556, ... thats cause Mencoder doesn't get lower then a Q of 2. That could be handled, but still ... we do end in unwanted spikes and for my personal taste it isnt worth that much more needed time to do an encode as the VISUAL quality in my eyes (and they arent bad at all) is miiiiiiinimal. The surfaces of the mencoder result ended up a tiny bit more plain, but in a style like beeing a bit erased. The CCE result ended up a minimal more uneasy in the surfaces, but on the other side it appears more natural and not like too much like beeing denoised. I do repeat: Im talking about MINIMAL impressions now.

And all this at the very first try :(

My Conclusion: I still do like Mencoder/Libavcodec for my very "own" purposes, but I do keep myself away from agreeing that it changed to a fully DVD compilant encoder. Not mention the still undersizing result issue etc.



Btw. the result from CCE.
(keep in mind this is NON-Linear! thats why you cant compare the Q values from CCE to mencoder 1:1). Just keep your eye on the right window resulted values.
I used in the CCE encode the resulted avg bitrate from mencoder: 3556kbits. Ok CCE also did undersize a bit, but not that much like mencoder.

http://www.digitalfaq.com/archives/i.../2006/03/2.gif



EDIT:

I have here a QuEnc062-alpha4 release which looks much more promising than Mencoder!

Also here set to 4000avg and 9000max.

http://www.digitalfaq.com/archives/i.../2006/03/3.gif

Final avg is almost reached and NO spikes. Q is almost lowered to 1 sometimes which makes higher avg bitrate results possible.

rds_correia 03-25-2006 07:49 AM

I was about to start testing when I saw your post, Andrej.
Yep, good old Mencoder still has a loong way to go...
BTW, did you wrote down a speed comparison between Mencoder and QuEnc 0.62-alpha4?
Just curious ;).

Sagittaire 03-25-2006 08:27 AM

well read my faq

Quote:

be carefull :

- final bitrate must be always inferior to fast first pass at q6. Ik you want know compressibility Q6 make little compressibility test (5% is enougth with source=SelectRangeEvery(source, 300, 15) for example).

- this configuration is insame quality setting. Use CCIR601 space color for better compressibility. I use this profil only for very low bitrate with adaptative avs script.
Quote:

---------------------------------------------------------------
First pass ...
---------------------------------------------------------------

Video stream: 2711.770 kbit/s (338971 B/s) size: 131534382 bytes 388.040 secs 9701 frames
PSNR: Y:45.47, Cb:47.22, Cr:48.03, All:46.07
1) first pass at q6 (vqscale=3) done 2711 Kbps. If you want no underflow you must use less than 2700 Kbps for final bitrate.

2) you want for final bitrate 4000 Kbps

You can't make encoding with your target bitrate simply because my mencoder profil have q4 saturation with this bitrate (like as you see on bitrate viewer). Use mencoder with this source for this target bitrate is simply useless here because all MPEG2 encoder will make high quality encoding with low average quant encoding (certainely something like average ~q3.5 for your source). For your source TMPGEnc KDVD profil use certainely something like ~CQ85 for target bitrate at 4000 Kbps and ~CQ70 for target bitrate at 2700 Kbps.


PS: Quantizer info from bitrate viewer seem false. FFDSHOW OSD done other result and IMO good result. IMO bitrate viewer don't analyse frame quantizer but read simply frame info. For example my profil use adaptative quantisation for IFrame and PFrame and bitrate viewer say "Linear Quantisation".

danpos 03-25-2006 08:10 PM

Problems
 
@Sagitaire

I'm not getting have Mencoder working properly! Please, take an eye in this Mencoder's log.txt:

Code:

-----------------------------------------------------------
Binary: C:\MENCODER\mencoder.exe
---------------------------------------------------------------
Source: JONNHY_ENGLISH.avs
Target: C:\MENCODER\JONNHY_ENGLISH.m2v
---------------------------------------------------------------

Conversion to raw mpeg2 starts ...

---------------------------------------------------------------
First pass ...
---------------------------------------------------------------

MEncoder Sherpya-MinGW-20060323-4.1.0 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Sempron/Athlon MP/XP/XP-M Barton,Thorton (Family: 6, Stepping: 0)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx

success: format: 0  data: 0x0 - 0x79
AVS file format detected.
VIDEO:  [YV12]  720x480  12bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:38  fourcc:0x32315659  size:720x480  fps:23.98  ftime:=0.0417
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [yuvcsp]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (720x480 fourcc=3267706d [mpg2])
High quality encoding selected (non real time)!
Using constant qscale = 3.000000 (VBR)
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
==========================================================================
Forcing output fourcc to 3247504d [MPG2]
Pos:  0.0s      1f ( 0%)  0.00fps Trem:  0min  0mb  A-V:0.000 [0:0]
[mpeg2video @ 00B7D35C]Error, Invalid timestamp=0, last=0
Muxer frame buffer cannot allocate memory!
Pos:  0.0s      2f ( 0%)  0.00fps Trem:  0min  0mb  A-V:0.000 [0:0]
[mpeg2video @ 00B7D35C]Error, Invalid timestamp=0, last=0
Muxer frame buffer cannot allocate memory!
Pos:  0.0s      3f ( 0%)  0.00fps Trem:  0min  0mb  A-V:0.000 [0:0]
[mpeg2video @ 00B7D35C]Error, Invalid timestamp=0, last=0
Muxer frame buffer cannot allocate memory!
Pos:  0.0s      4f ( 0%)  0.00fps Trem:  0min  0mb  A-V:0.000 [0:0]
[mpeg2video @ 00B7D35C]Error, Invalid timestamp=0, last=0
Muxer frame buffer cannot allocate memory!
Pos:  0.0s      5f ( 0%)  0.00fps Trem:  0min  0mb  A-V:0.000 [0:0]
[mpeg2video @ 00B7D35C]Error, Invalid timestamp=0, last=0
Muxer frame buffer cannot allocate memory!
Pos:  0.0s      6f ( 0%)  0.00fps Trem:  0min  0mb  A-V:0.000 [0:0]
[mpeg2video @ 00B7D35C]Error, Invalid timestamp=0, last=0

I'm using a simple AVS script which just calling the MPEG2 decoder and
delivers the frames to Mencoder:

Code:

LoadPlugin("C:\Arquivos de programas\Programas sem instaladores\DGIndex\DGDecode.dll")
MPEG2Source("JONNHY_ENGLISH.d2v")

I'm using the Inc's modified profile in which I added the -ofps 24000/1001 -nosound options to profile!

Another questions is related to your FAQ: It isn't clear the way (procedure) to know which the final bitrate must to be set up in profile. I'd appreciate a better explanation about the issue.

Any advise is highly appreciated, mate!

TIA,

Sagittaire 03-26-2006 05:35 AM

1) Well unfurtunaly mencoder-cvs-20060323 seem buggy. This version drop first frame and broke multipass stat file.

Use previous versions like mencoder-cvs-20060321. Here mencoder/mpalayer package (don't forget .dll for this compilation)
http://ffdshow.faireal.net/mirror/mplayer/

2) Make simply compressibility test at Q6 (vqscale=3)

If your encodage.avs script is

Code:

source=DirectShowSource("D:\...\azerty.mp4", fps=23.976)
source=Lanczos4Resize(source,720,432)
source=addborders(source,0,72,0,72)
source=AssumeFPS(source,25)
source=limiter(source)
Return(source)

add simply source=SelectRangeEvery(source, 300, 15) command for make 5% encoding and partial compressibility test like this:

Code:

source=DirectShowSource("D:\...\azerty.mp4", fps=23.976)
source=SelectRangeEvery(source, 300, 15)
source=Lanczos4Resize(source,720,432)
source=addborders(source,0,72,0,72)
source=AssumeFPS(source,25)
source=limiter(source)
Return(source)

source=SelectRangeEvery(source, 300, 15) -> 5% of frame tested
source=SelectRangeEvery(source, 150, 15) -> 10% of frame tested

If your compressibility test at Q6 (first pass in my profil) done 2500 Kbps then you must use less than 2500 Kbps for complete encoding.

Sagittaire 03-26-2006 07:17 AM

Quote:

PS: Quantizer info from bitrate viewer seem false. FFDSHOW OSD done other result and IMO good result. IMO bitrate viewer don't analyse frame quantizer but read simply frame info. For example my profil use adaptative quantisation for IFrame and PFrame and bitrate viewer say "Linear Quantisation".
bug is confirmed by DBZ : Quantizer info from Bitrate Viewver are simply totaly false for all Libavcodec codec like Mencoder or QEnc ... :wink:

danpos 03-26-2006 09:43 AM

Thanks.
 
@Sagittaire

Thanks a lot, mate!! As a matter of fact, the combo Mencoder/Mplayer which I was using were buggy. Using Mencoder/Mplayer CVS-20060321 did a trick.

Regard on my question about the procedure to be used for find out which average bitrate must to be set up into profile, I've to say that now I got it!! :D

Follows my result with a small clip from a DVD of mine:

Code:

---------------------------------------------------------------
Binary: C:\MENCODER\mencoder.exe
---------------------------------------------------------------
Source: JONNHY_ENGLISH.avs
Target: C:\MENCODER\JONNHY_ENGLISH.m2v
---------------------------------------------------------------

Conversion to raw mpeg2 starts ...

---------------------------------------------------------------
Third pass ...
---------------------------------------------------------------

MEncoder dev-CVS-060321-16:16-4.0.2 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Sempron/Athlon MP/XP/XP-M Barton,Thorton (Family: 6, Stepping: 0)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

91 audio & 206 video codecs
success: format: 0  data: 0x0 - 0x79
AVS file format detected.
VIDEO:  [YV12]  720x480  12bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:38  fourcc:0x32315659  size:720x480  fps:23.98  ftime:=0.0417
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [yuvcsp]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (720x480 fourcc=3267706d [mpg2])
High quality encoding selected (non real time)!
Using constant qscale = 3.000000 (VBR)
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
==========================================================================

Video stream: 1789.754 kbit/s  (223719 B/s)  size: 34701830 bytes  155.113 secs  3719 frames
PSNR: Y:45.10, Cb:48.48, Cr:49.21, All:46.03

The average bitrate set up into profile was 1790 Kbit/s! (error of -0.014%).

No buffer underrun errors at all.

Bitrate graph (by DVD-Lab tool):

http://www.digitalfaq.com/archives/i.../2006/03/1.jpg

(Max bitrate set up into profile was 5500 Kbit/s - It was respected).

Encoded sample: Donwload it here.

Dialhot 03-26-2006 12:23 PM

Re: Thanks.
 
Quote:

Originally Posted by danpos
(Max bitrate set up into profile was 5500 Kbit/s - It was respected).

Except that DBDLabPro gives an average value of 2190 (VERY far from 1790) and a peak about 4364 where the graph shows a position above 5000 (possibly a diff in the unit used for both informations)

Quote:

Originally Posted by Sagittaire
bug is confirmed by DBZ : Quantizer info from Bitrate Viewver are simply totaly false for all Libavcodec codec like Mencoder or QEnc ... :wink:

And now this is Bitrate viewver that is buggy and of course not this wonderfull, marvelous, amazing fully 1000% percent best MPEG12345678 encoder ever.

For me this is enought. This lavcodec joke is definitely over me. Bye.

danpos 03-26-2006 12:54 PM

Re: Thanks.
 
Quote:

Originally Posted by Dialhot
Except that DBDLabPro gives an average value of 2190 (VERY far from 1790) and a peak about 4364 where the graph shows a position above 5000 (possibly a diff in the unit used for both informations)

Yep, I already there was noted this behaviour. Bitrate Viewer from TECO also shows diferent values for average bitrate (and when pulldown is applied to videostream, the bitrate viewers apps increase artificially the average bitrate showed, this is a PITA).

Regard on the bitrate graph from Lab I did see this peak and it is lower than 5500 Kbits/s. Regard on the informations showed by BG from DVDLab, we can see the instant bitrate as a histogram (which are coloured with purple) and a continuous distribution (which is a approach done in a way that I don't know) coloured by blue. Seems to me that the informations about average/max bitarate are related to continous distribution, but I'm not sure.

BTW, VDM shows that average bitrate is 1790 Kbits/s (which is the correct since the it matches the target file size).

Regards,

danpos 03-26-2006 01:28 PM

Bitrate graphs.
 
@Dialhot

Considering still the bitrate graphs question:

*Source (ripped DVD):

http://www.digitalfaq.com/archives/error.gif

*Encoded with Mencoder (Sagittaire/Inc profile - this is from the Sample.iso which I provided for download here):

http://www.digitalfaq.com/archives/error.gif

Considering the informations from BV, both strems are in compliance with DVD spec.

Regard on the second screenshot, we can se that peak/average bitrate are so far away the values showed by BV from Lab (yeah, this is crazy! 8O ). We can see that max bitrate was respected.

Regards,

incredible 03-26-2006 02:34 PM

Quote:

For example my profil use adaptative quantisation for IFrame and PFrame and bitrate viewer say "Linear Quantisation".
Do you think these arguments just are enough to do encode in a non-linear mode? Even if they do "sound" so? Gimme a clear documentation if this from somewhere - like the mencoder docu.

When using ffdshows Q value info output a Q of constant 4 is shown and only integer Q's are supported (floats are up rounded!).

However .... there was a clear spike in the encoding.

Ill do focus more the developing of Qenc as it seems more DVD compilant (if just beleiving in values). I dont need to do complex tasks like first pass Q resulted bitrate into account taking etc. like in mencoder.

Also ..... That slow encoding process and up to this in a three pass to me its not worth just for these little math values behind comma. Especially not when doing a 1:1 VISUAL comparison.


The easiest comparison is.

Do take both m2v resulted streams to compare and process them by using Dgindex. After this use this script:

a=dgdecode_mpeg2source("MyMencoderOutput.d2v").Sub title("Mencoder")
b=dgdecode_mpeg2source("MyXXXencoderOutput.d2v").S ubtitle("XXXencoder")
interleave(a,b)

now .... you simply can switch between both streams just using back and forth in the frame steps. And thats what what Im interested in. And sorry to say .. not in a math value taken from an average.


All times are GMT -5. The time now is 11:44 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2026 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2026 Jelsoft Enterprises Ltd.