View Full Version : Advice need. Append video in AviSynth.
Vitaliy Gorbatenko
12th December 2009, 05:40
code:
#
SetMemoryMax(1024)
#
# PLUGINS
SetWorkingDir("C:\system\Knot\AviSynthPlugins\")
import("!Allinclude.avsi")
import("srestore2.avsi")
# SOURCE
mpeg2source("H:\Encoding\test.d2v", cpu2="oooooo", info=3)
a=colormatrix(interlaced=true, hints=true)
pa=a.trim(0, 28053).animeivtc(mode=1,aa=0)
pb=a.trim(28054, 28110).TempGaussMC_beta1u().srestore2(frate=23.976)
return (pa+pb)#.crop(8,0,-6,0).Spline64Resize(880,496)
pb is added correctly to pa
#
SetMemoryMax(1024)
#
# PLUGINS
SetWorkingDir("C:\system\Knot\AviSynthPlugins\")
import("!Allinclude.avsi")
import("srestore2.avsi")
# SOURCE
mpeg2source("H:\Encoding\test.d2v", cpu2="oooooo", info=3)
a=colormatrix(interlaced=true, hints=true)
pa=a.trim(0, 28053).animeivtc(mode=1,aa=0)
pb=a.trim(28054, 28110).TempGaussMC_beta1u().srestore2(frate=23.976)
pc=a.trim(28111, 0).animeivtc(mode=1,aa=0)
return (pa+pb+pc)#.crop(8,0,-6,0).Spline64Resize(880,496)
pb is absent in video :confused:
Why it is impossible to add a piece (pb)?
Vitaliy Gorbatenko
12th December 2009, 07:11
SRestore2 is same as SRestore, but without memory leak.
MadRat
12th December 2009, 07:23
Normally when you append videos you do it like this:
video1 = mpeg2source("filenameA.ext")
video2 = mpeg2source("filenameB.ext")
video3 = mpeg2source("filenameC.ext")
finalvideo = video1 ++ video2 ++ video3
I'm doing this off the top of my head so I hope I don't have it wrong.
Vitaliy Gorbatenko
12th December 2009, 10:56
That's just the point! I cannot add clips in to one. The second is lost. return(a+b) work! return(a+b+c) don't work.
If not to use difficult functions - that so works:
pa=a.trim(0, 28053)
pb=a.trim(28054, 28110).Invert()
pc=a.trim(28111, 0)
return (pa+pb+pc)
syntax error - Does not appear and on an exit I have the necessary number of frames..
Gavino
12th December 2009, 11:39
My memory leak fix has now been incorporated in the official SRestore (http://avisynth.org/mediawiki/upload/7/7d/Srestore.avsi) version. I see that my srestore2 has been renamed srestore_inside to avoid confusion. (Incidentally, it doesn't avoid the use of ScriptClip, it just makes the ScriptClip string very much smaller.)
Vitaliy, can you confirm you have a self-consistent srestore function (perhaps renamed by you to srestore2?).
When you say pb is missing, what do you mean exactly? Does the total framecount match only pa+pc?
Vitaliy Gorbatenko
28th December 2009, 19:06
Sorry for late answer... Yes, with official version the same situation.
pb missing - i'm see in stream pa and pc part.
And it's not FPS problemm:
f_int=colormatrix(interlaced=true, hints=true)
a=f_int.trim(0, 1177).animeivtc(mode=1,aa=0).AssumeFPS(23.976)
b=f_int.trim(1178, 1243).TempGaussMC_beta1u().srestore(frate=23.976).AssumeFPS(23.976)
c=f_int.trim(1244, 0).animeivtc(mode=1,aa=0).AssumeFPS(23.976)
a+b+c
don't work too.
Gavino
29th December 2009, 11:29
Perhaps the problem is with animeivtc - it may be that it doesn't work if called more than once in a script.
thetoof
31st December 2009, 23:52
1 - why don't you use something like this to avoid unnecessary multiple calls of the same function (for a starter, it wastes less memory)?:
ivtced = f_int.animeivtc(mode=1,aa=0)
bobbed = f_int.TempGaussMC_beta1u().srestore(frate=23.976)
ivtced.trim(blah)+bobbed.trim(blah)+ivtced.trim(blah)
2 - why do you need to do bob+use blend-aware decimation on a section and not the others?
Vitaliy Gorbatenko
6th January 2010, 09:27
1. I'm not very smart enough... In this chain of filters is difficult to determine from what and at what frame is cut, so wanted to cut the source, and then perform deinterlacing.
2. video source has mastering errors (or codec bug...) most 3:2 and some parts pure interlaced..
thetoof
6th January 2010, 19:29
Can you send a small sample (5-10mb) of the unprocessed source? I'd like to check those interlaced sections.
Vitaliy Gorbatenko
7th January 2010, 11:55
Short sample here : http://www.mediafire.com/?micxtojzoz0
Frames 454-498 are not normal.
thetoof
8th January 2010, 15:55
heh, I see what you mean. Looks like they added the "shaking" after applying 3:2 pulldown, creating 30i motion.
-I wouldn't recommend going to 24fps, as you have 60fps (after bobbing) worth of motion
-Creating a VFR clip would be the way to go imo.
I'm having a problem detecting the 30p sections with tdecimate because of the peculiar way it was done, so I'll have to ask in tivtc's thread.
edit - I created a new cfr mode for you. http://www.sendspace.com/file/nt1n7z Since it won't really matter and won't be noticed that frames are dropped since the motion is only "frame shaking", try this :
animeivtc(mode=1,e1=454,i1=503,e2=628,omode=1,credconv="drop")
Vitaliy Gorbatenko
9th January 2010, 09:55
At a lot better! Could you make these changes on an ongoing basis. Because these errors occur often enough though, but trouble with them very much.
thetoof
9th January 2010, 19:00
I don't get what you want to say
Which changes, which errors?
Vitaliy Gorbatenko
9th January 2010, 20:40
Sorry for my bad english... You created a new cfr mode for me.. I want this mode remains in FUTURE versions .. Since these moments interlacing from time to time appear in the source material ...
thetoof
9th January 2010, 21:09
Yes, sure. As you might have noticed, I sent you the "dev copy", meaning it is the script I'm currently working on. There are a few things to test and correct for vfr and once it's done, the changes and corrections (for both cfr and vfr) will be uploaded as 2.01.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.