Log in

View Full Version : What about 2pass, 1st pass full dvd, 2nd individual chapter?


SoreGums
18th December 2004, 13:39
EDIT:
if you can think of a better title for this thread SPEAK UP!


Environment
-----------
MPlayer-1.0pre5try2 (mencoder)
xvid codec
PII 450
192MB RAM
Win XP Pro
X-Men DVD

Converting X-Men DVD to XviD (704x432 @ 1400kbps @ 25fps @ 2 pass)

Ok so I had my computer on a marathon encode it took about 26hrs
(idle process priority) to do the first pass. (Note I've been testing
and what not on just the first 3000 frames :P). Then on the 2nd pass
today for some reason the computer restarted!!!!
(about 35%, 8hrs, i was at work)
not happy about that. . .

So my question is, since I have this 5meg stats file from the first
pass, can I just encode each chapter individually then join them all
up at the end, so that if for some reason the computer bombs out again
I'll only loose the current chapter in progress instead of the only
lot?

In essence would the second pass use the right part of the stats file
for what it is encoding?

Commands would be the following:

start "Converting X-Men - 1st pass - all" /low /wait mencoder dvd://1 -dvd-device k: -vf crop=704:432:10:76,hqdn3d=2:1:2 -oac copy -ovc xvid -xvidencopts pass=1:<options same for all> -o j:\xmen.01.avi

start "Converting X-Men - 2nd pass - chapter 1" /low /wait mencoder dvd://1 -chapter 1-1 -dvd-device k: -vf crop=704:432:10:76,hqdn3d=2:1:2 -oac copy -ovc xvid -xvidencopts pass=2:bitrate=1400:<options same for all> -o j:\xmen.01.ch.01.avi
...
start "Converting X-Men - 2nd pass - chapter 15" /low /wait mencoder dvd://1 -chapter 15-15 -dvd-device k: -vf crop=704:432:10:76,hqdn3d=2:1:2 -oac copy -ovc xvid -xvidencopts pass=1:bitrate=1400:<options same for all> -o j:\xmen.01.ch.15.avi

copy xmen.01.ch.01.avi+...+xmen.01.ch.15.avi xmen.01.all.avi
mencoder -noidx -ovc copy -oac copy -o xmen.01.final.avi xmen.01.all.avi

Would this work? I've just finished the first chapter, am moving onto
the 2nd chapter shortly (after I've burnt some DVD-R's need disk
space) would like to know if I'm going to be doing this all for
nothing or not :)

celtic_druid
18th December 2004, 16:44
So you had your DVDRom running for over 24hours?

akupenguin
18th December 2004, 22:04
No, this won't work. The first chapter is fine. But xvid doesn't know that the subsequent chapters aren't starting at the beginning of the log, so it'll match up the frames to the wrong entries, and totally screw up ratecontrol (i.e. worse results than 1pass).

It is possible to do what you ask, but requires some more complex scripting:
encode 1st pass.
encode 2nd pass chapter 1.
remove all frames encoded so far from the beginning of the 2pass logfile.
adjust requested bitrate to match the amount of space left from your desired total size.
move to next chapter; repeat.

SoreGums
19th December 2004, 13:12
Originally posted by celtic_druid
So you had your DVDRom running for over 24hours?
Well, on & off, idle process priority means that if I was on the
computer and doing stuff it would interupt it... And reading on
further down, the drive has been spinning since 0400 its now 2200...

Originally posted by akupenguin
No, this won't work. The first chapter is fine. But xvid doesn't
know that the subsequent chapters aren't starting at the beginning of
the log, so it'll match up the frames to the wrong entries, and
totally screw up ratecontrol (i.e. worse results than
1pass).
That's what I thought, thanks

So I decided to this instead :) Now at least if I have to reset the
computer I can just start off where I left off :)

@echo off
title=Converting X-Men DVD -> XviD
cls

:: Start Chapter
SET sch=1
:: End Chapter
SET fch=15

IF EXIST xmen.log move /Y xmen.log xmen.old.log

echo Converting X-Men DVD -^> XviD
echo Converting X-Men DVD -^> XviD >> xmen.log
echo --------- S T A R T --------
echo --------- S T A R T -------- >> xmen.log

For /L %%C In (%sch%,1,%fch%) Do (

if %%C LSS 10 (
echo Chapter 0%%C - 1st pass
echo Chapter 0%%C - 1st pass >> xmen.log
start /min /high /wait mencoder dvd://1 -chapter %%C-%%C -dvd-device k: -vf crop=704:432:10:76,hqdn3d=2:1:2 -oac copy -ovc xvid -xvidencopts pass=1:me_quality=6:nointerlacing:vhq=1:autoaspect:trellis:closed_gop:chroma_me:chroma_opt:quant_type=mpeg:quant_intra_matrix=eqm_v3lr.intra:quant_inter_matrix=eqm_v3lr.inter -o j:\xmen.01.ch0%%C.avi

echo Copy xvid-twopass.stats -^> j:\xmen.01.ch0%%C.stats
echo Copy xvid-twopass.stats -^> j:\xmen.01.ch0%%C.stats >> xmen.log
copy /Y xvid-twopass.stats j:\xmen.01.ch0%%C.stats >> xmen.log

echo Chapter 0%%C - 2nd pass
echo Chapter 0%%C - 2nd pass >> xmen.log
start /min /high /wait mencoder dvd://1 -chapter %%C-%%C -dvd-device k: -vf crop=704:432:10:76,hqdn3d=2:1:2 -oac copy -ovc xvid -xvidencopts pass=2:bitrate=1400:me_quality=6:nointerlacing:vhq=1:autoaspect:trellis:closed_gop:chroma_me:chroma_opt:quant_type=mpeg:quant_intra_matrix=eqm_v3lr.intra:quant_inter_matrix=eqm_v3lr.inter -o j:\xmen.01.ch0%%C.avi

) else (
echo Chapter %%C - 1st pass
echo Chapter %%C - 1st pass >> xmen.log
start /min /high /wait mencoder dvd://1 -chapter %%C-%%C -dvd-device k: -vf crop=704:432:10:76,hqdn3d=2:1:2 -oac copy -ovc xvid -xvidencopts pass=1:me_quality=6:nointerlacing:vhq=1:autoaspect:trellis:closed_gop:chroma_me:chroma_opt:quant_type=mpeg:quant_intra_matrix=eqm_v3lr.intra:quant_inter_matrix=eqm_v3lr.inter -o j:\xmen.01.ch%%C.avi

echo Copy xvid-twopass.stats -^> j:\xmen.01.ch%%C.stats
echo Copy xvid-twopass.stats -^> j:\xmen.01.ch%%C.stats >> xmen.log
copy /Y xvid-twopass.stats j:\xmen.01.ch%%C.stats >> xmen.log

echo Chapter %%C - 2nd pass
echo Chapter %%C - 2nd pass >> xmen.log
start /min /high /wait mencoder dvd://1 -chapter %%C-%%C -dvd-device k: -vf crop=704:432:10:76,hqdn3d=2:1:2 -oac copy -ovc xvid -xvidencopts pass=2:bitrate=1400:me_quality=6:nointerlacing:vhq=1:autoaspect:trellis:closed_gop:chroma_me:chroma_opt:quant_type=mpeg:quant_intra_matrix=eqm_v3lr.intra:quant_inter_matrix=eqm_v3lr.inter -o j:\xmen.01.ch%%C.avi

)
echo.
)

echo ---------- D O N E ---------
echo ---------- D O N E --------- >> xmen.log

Leak
19th December 2004, 13:23
Originally posted by SoreGums
And reading on
further down, the drive has been spinning since 0400 its now 2200...

Are you sure that this is good for your DVD drive?

How about making an image with DVD Decrypter, mounting it with Daemon Tools and using that? It would surely save your DVD drive a lot of wear and tear...

np: Autechre - Eidetic Casein (Confield)

SoreGums
19th December 2004, 13:49
Originally posted by Leak
Are you sure that this is good for your DVD drive?

How about making an image with DVD Decrypter, mounting it with Daemon Tools and using that? It would surely save your DVD drive a lot of wear and tear...
I have nfi as to wheather its good or not...
I did think of this after reading the 1st comment about this, might do that actually :)

Also wanted to comment that with that script and the copying of the stats file i can easily redo the 2nd pass with a different bitrate if i wanted to which is good for me as it save some time :)

akupenguin
19th December 2004, 21:32
Originally posted by SoreGums
So I decided to this instead :) Now at least if I have to reset the
computer I can just start off where I left off :)
Better, but still suboptimal: you're now forcing each chapter to have the same average bitrate. This is better than CBR, but may or may not be better than constant quant, depending on how much complexity varies over time.

SoreGums
20th December 2004, 10:15
well what a lot of good that didn't do :(

Between every chapter there is a really obvious break!

Back to square one, looks like I'll just have to hope nothing happens to computer while encoding :/

Glad I saved my 1st pass stats file for the xmen dvd tho, that'll same some time ;)

Caspar
21st December 2004, 06:28
It's just a matter of time before some thing bad will happen to your computer if you encode from your DVD drive like you are doing now...