Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Antronio's DV ambassador
Join Date: Mar 2006
Location: Santiago, Chile
Posts: 115
|
Avisynth error while encoding with HCEnc
Hi, I'm making a DVD-9 with sports footage and got some problems when encoding to MPEG-2 with HCEnc. This is the script used:
Code:
setmemorymax(1024) import("Trans.avsi") a=avisource("01.avi") b=avisource("02.avi") c=avisource("03.avi") d=avisource("04.avi") e=avisource("05.avi") f=avisource("06.avi") g=avisource("07.avi") h=avisource("08.avi") i=avisource("09.avi") j=avisource("10.avi") k=avisource("11.avi") l=avisource("12.avi") m=avisource("13.avi") n=avisource("14.avi") o=avisource("15.avi") p=avisource("16.avi") q=avisource("17.avi") r=avisource("18.avi") s=avisource("19.avi") t=avisource("20.avi") u=avisource("21.avi") v=avisource("22.avi") w=avisource("23.avi") x=avisource("24.avi") y=avisource("grupos.avi") Trans(a.fadein(15),b.trim(0,b.framecount-31))\ +trans(b.trim(b.framecount-30,0),c.trim(0,c.framecount-31))\ +trans(c.trim(c.framecount-30,0),d.trim(0,d.framecount-31))\ +trans(d.trim(d.framecount-30,0),e.trim(0,e.framecount-31))\ +trans(e.trim(e.framecount-30,0),f.trim(0,f.framecount-31))\ +trans(f.trim(f.framecount-30,0),g.trim(0,g.framecount-31))\ +trans(g.trim(g.framecount-30,0),h.trim(0,h.framecount-31))\ +trans(h.trim(h.framecount-30,0),i.trim(0,i.framecount-31))\ +trans(i.trim(i.framecount-30,0),j.trim(0,j.framecount-31))\ +trans(j.trim(j.framecount-30,0),k.trim(0,k.framecount-31))\ +trans(k.trim(k.framecount-30,0),l.trim(0,l.framecount-31))\ +trans(l.trim(l.framecount-30,0),m.trim(0,m.framecount-31))\ +trans(m.trim(m.framecount-30,0),n.trim(0,n.framecount-31))\ +trans(n.trim(n.framecount-30,0),o.trim(0,o.framecount-31))\ +trans(o.trim(o.framecount-30,0),p.trim(0,p.framecount-31))\ +trans(p.trim(p.framecount-30,0),q.trim(0,q.framecount-31))\ +trans(q.trim(q.framecount-30,0),r.trim(0,r.framecount-31))\ +trans(r.trim(r.framecount-30,0),s.trim(0,s.framecount-31))\ +trans(s.trim(s.framecount-30,0),t.trim(0,t.framecount-31))\ +trans(t.trim(t.framecount-30,0),u.trim(0,u.framecount-31))\ +trans(u.trim(u.framecount-30,0),v.trim(0,v.framecount-31))\ +trans(v.trim(v.framecount-30,0),w.trim(0,w.framecount-31))\ +trans(w.trim(w.framecount-30,0),x.trim(0,x.framecount-31))\ +trans(x.trim(x.framecount-30,0),y.fadeout(25)) reinterpolate411() converttoyv12() Code:
Function Trans(clip src1, clip src2) { trof=ImmaRead("F:\highlights\trans.png") cua=FrameCount(src1) TransWipe(src1,src2,25,"left") animate(cua-30,cua+5,"overlay", trof,720,0,showalpha(trof),1.0,"blend", trof,-300,0,showalpha(trof),1.0,"blend") } Please somebody help me solve this issue. Saludos By ALEX-KID |
![]() |
![]() |
![]() |
#2 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,430
|
To reduce memory usage, you can move the call of ImmaRead
Code:
trof=ImmaRead("F:\highlights\trans.png") Code:
Function Trans(clip src1, clip src2, clip trof) |
![]() |
![]() |
![]() |
#4 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,430
|
Quote:
The point is that ImmaRead was being called many times when it is always using the same image and so only needs to be called once. In the case of TransWipe, you still need to call it once per transition, so you can't get rid of any calls - whether you call it inside or outside the function doesn't matter. If this still doesn't work, try simplifying your script in different ways to find out what is to blame. Things to try: - replace TransWipe by simple Dissolve; - replace animated overlay by a static one; - remove overlay altogether. |
|
![]() |
![]() |
![]() |
#5 | Link |
Antronio's DV ambassador
Join Date: Mar 2006
Location: Santiago, Chile
Posts: 115
|
OK, thanks for your advice.
This time the new script was fully processed by HCEnc, but the output looks corrupt at minute 21, and the filesize is about 10.7 GB. I think it's still related to memory usage (when processing it reached about 1.4 GB but didn't stopped) so i'll keep trying. Saludos By ALEX-KID |
![]() |
![]() |
![]() |
#6 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Lose the setmemorymax(1024)!
This controls the size of the video frame cache it does not control the memory usage for other purposes. You only have 2 gigabytes of address space for a 32 bit process, allocating 50% to the frame cache is not very smart. For linear scripts with no temporal component a big cache serves no purpose. Also animating Overlay will burn memory like there is no tomorrow. Look into using the conditional variables that can control Overlays behaviour as an alternative. |
![]() |
![]() |
![]() |
#7 | Link |
Antronio's DV ambassador
Join Date: Mar 2006
Location: Santiago, Chile
Posts: 115
|
I always refused to learn the usage of conditional variables, but this time I think I have no choice. And I didn't know SetMemoryMax just got to do with video frame cache. There's always something new you can learn every day.
Thank you IanB Saludos By ALEX-KID |
![]() |
![]() |
![]() |
#8 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,430
|
Quote:
![]() However, an alternative might be to pre-create the animated overlay as an external RGB32 clip (with transparency) and use that instead of the static image in your Trans function. |
|
![]() |
![]() |
![]() |
#9 | Link |
Antronio's DV ambassador
Join Date: Mar 2006
Location: Santiago, Chile
Posts: 115
|
Before learning conditional scripting (still refusing it
![]() By the way, should memory usage be reduced by doing this? Saludos By ALEX-KID ---------------------EDIT---------------------------- I reply myself: it is reduced, and finally got my video done. This is the last script: Code:
import("Trans.avsi") a=avisource("01.avi") b=avisource("02.avi") c=avisource("03.avi") d=avisource("04.avi") e=avisource("05.avi") f=avisource("06.avi") g=avisource("07.avi") h=avisource("08.avi") i=avisource("09.avi") j=avisource("10.avi") k=avisource("11.avi") l=avisource("12.avi") m=avisource("13.avi") n=avisource("14.avi") o=avisource("15.avi") p=avisource("16.avi") q=avisource("17.avi") r=avisource("18.avi") s=avisource("19.avi") t=avisource("20.avi") u=avisource("21.avi") v=avisource("22.avi") w=avisource("23.avi") x=avisource("24.avi") y=avisource("grupos.avi") a.trim(0,a.framecount-31).fadein(15)+trans(a.trim(a.framecount-30,0),b.trim(0,30))\ +b.trim(31,b.framecount-31)+trans(b.trim(b.framecount-30,0),c.trim(0,30))\ +c.trim(31,c.framecount-31)+trans(c.trim(c.framecount-30,0),d.trim(0,30))\ +d.trim(31,d.framecount-31)+trans(d.trim(d.framecount-30,0),e.trim(0,30))\ +e.trim(31,e.framecount-31)+trans(e.trim(e.framecount-30,0),f.trim(0,30))\ +f.trim(31,f.framecount-31)+trans(f.trim(f.framecount-30,0),g.trim(0,30))\ +g.trim(31,g.framecount-31)+trans(g.trim(g.framecount-30,0),h.trim(0,30))\ +h.trim(31,h.framecount-31)+trans(h.trim(h.framecount-30,0),i.trim(0,30))\ +i.trim(31,i.framecount-31)+trans(i.trim(i.framecount-30,0),j.trim(0,30))\ +j.trim(31,j.framecount-31)+trans(j.trim(j.framecount-30,0),k.trim(0,30))\ +k.trim(31,k.framecount-31)+trans(k.trim(k.framecount-30,0),l.trim(0,30))\ +l.trim(31,l.framecount-31)+trans(l.trim(l.framecount-30,0),m.trim(0,30))\ +m.trim(31,m.framecount-31)+trans(m.trim(m.framecount-30,0),n.trim(0,30))\ +n.trim(31,n.framecount-31)+trans(n.trim(n.framecount-30,0),o.trim(0,30))\ +o.trim(31,o.framecount-31)+trans(o.trim(o.framecount-30,0),p.trim(0,30))\ +p.trim(31,p.framecount-31)+trans(p.trim(p.framecount-30,0),q.trim(0,30))\ +q.trim(31,q.framecount-31)+trans(q.trim(q.framecount-30,0),r.trim(0,30))\ +r.trim(31,r.framecount-31)+trans(r.trim(r.framecount-30,0),s.trim(0,30))\ +s.trim(31,s.framecount-31)+trans(s.trim(s.framecount-30,0),t.trim(0,30))\ +t.trim(31,t.framecount-31)+trans(t.trim(t.framecount-30,0),u.trim(0,30))\ +u.trim(31,u.framecount-31)+trans(u.trim(u.framecount-30,0),v.trim(0,30))\ +v.trim(31,v.framecount-31)+trans(v.trim(v.framecount-30,0),w.trim(0,30))\ +w.trim(31,w.framecount-31)+trans(w.trim(w.framecount-30,0),x.trim(0,30))\ +x.trim(31,x.framecount-31)+trans(x.trim(x.framecount-30,0),y.trim(0,30))\ +y.trim(31,0).fadeout(25) reinterpolate411() converttoyv12() ![]() Saludos to everyone By ALEX-KID Last edited by Alex-Kid; 7th August 2009 at 17:05. Reason: File encoded at last! |
![]() |
![]() |
![]() |
Tags |
avisynth, error, hcenc, transall |
Thread Tools | Search this Thread |
Display Modes | |
|
|