View Full Version : Frame Ghosting, Blending, Blur Problem
Gargantula
11th February 2006, 17:36
Ghosting Problems in Credits screen
I have searched the forum and found similar threads with problems as I have encountered, but the explanations the people give to try to help and very hard to understand for a newbie like me. I know how to program Visual Basic so I tried my hand in trying to fix my problem with the many plugins for AviSynth, but I am frustrated as it is hard to configure the many settings and parameters correctly. For example, I have no idea how to make the FixBlendIVTC AVS script to run in StaxRip. My source does not need IVTC though.
I am using the latest version of StaxRip to encode my videos. The original Mpeg2 from SageTV as I recorded the show did not have the ghosting problem only when viewed through the Preview window in StaxRip and with the encoded file. I am encoding with the DivX 6.1 codec. The source is interlaced and when I try to do a IVTC a frame skipping problem occurs so I assume the source is not telecined.
Please explain in detail what I have to do to fix this. I truly appreciate the help. I have many huge videos (many GBs of data) waiting to be encoded, but I want to do it right instead of ignoring the issue and encoding them all, since the rest of the video looks ok, it’s only the credits where the ghosting problem is really apparent. It is probably because of the high contrast that it is easy to see.
Every frame is ghosted like in the attachment.
Thank You.
jel
13th February 2006, 01:03
hi Gargantula and welcome to the forum!
i will move this thread to the avisynth usage forum where hopefully one of the gurus there can help you out (or move the thread again to a more appropriate forum)
good luck
j
foxyshadis
13th February 2006, 01:38
Credits have a bad habit of being made differently than the main feature. The best thing to do would be to take the avisynth script you've made and split the credits up to filter separately:
Source()
credits=trim(131842,0)
trim(0,131841)
# deinterlace and filter main feature
return credits # comment out once you've checked them out
credits=credits.LeakKernelDeint() # or IVTC, or whatever needs to be done, but be mindful of the framerate
last++credits
While working on it, you should use "return credits" early on to find out what you're dealing with. You shouldn't have to fixblendivtc them, you usually only see that when a dvd is processed incorrectly after ripping.
dukey
13th February 2006, 02:35
looks like a classic example of deinterlace by blending the fields together
try motion compensation
or even/odd field deinterlace on credits if the ghosting bothers u
MOmonster
13th February 2006, 11:23
A small sample would be nice.:)
I donīt know the program staxrip. Can you use avs scripts with it?
Such a avs function like FixBlendIVTC, restore24 and many others can be loaded into your avs script. Than you can use the function with your parameters.
Gargantula
13th February 2006, 20:38
To foxyshadis,
What do I do with that code? The avisynth script I was trying to write doesn't work, to correct it tha problem I have. I'm just learning how to write it.
To dukey,
How do I do that?
The program StaxRip is located on www.planetdvb.net/staxrip. It's a neat program based on DVX. Basically, it's DVD 2 with a new name.
Thank you for your help guys. I am confused with getting the script to initialize correctly in StaxRip. Just like programming, everything has to be exact to work.
I don't know much about how to use Avisynth without using StaxRip and even then I am still learning with StaxRip. That's why this was posted in the newbie section.
Here is a link to a 300 frame (no audio) DivX sample:
http://studentpages.scad.edu/~wceden20/ghosting.zip
foxyshadis
14th February 2006, 00:13
The sample really has to be source to be useful. If size is a problem, even a 30-frame trimmed segment that shows the problem should be enough. You can cut using dgindex's demux video, or cutterman xp.
Can you also post the entire generated avisynth script, as well as the modifications you're trying to make to it? That would help me give you an exact script to try.
Gargantula
14th February 2006, 16:46
Silly me! Sorry, okay here is the MPEG-2 source (same link):
http://studentpages.scad.edu/~wceden20/ghosting.zip
Sorry, but I got fed up trying avisnyth :confused: that I deleted my project file to start fresh because it was getting really messy since I was tried:
FixBlendIVTC
Remove Blend
Unblend
Would these even fix it? I am not sure, but when I searched the forum I came up with those possible solutions.
foxyshadis
14th February 2006, 20:12
Okay, there's no blending at all in the source, straight interlaced, so it must be the deinterlacing causing it. If you're happy with the main movie, just trim the credits off, filter them separately, and reattach.
mpeg2Source()
creditframe = 131842 # this is whatever frame your credits start on
credits=trim(creditframe,0)
trim(0,creditframe-1)
# deinterlace and filter main feature
credits=credits.bob().selecteven()
last++credits
Even a brain-dead deinterlacing works better with credits. ^.~ No need to unblend anything now. The source itself is jerky, so you can't really do much about that. The stuff you had for your main script goes in "# deinterlace and filter main feature".
Gargantula
14th February 2006, 20:57
Thanks, but where do I put the code in StaxRip?
Also, so I need to trim the credits off and do not interlace it? In StaxRip there is the option of Fast Deinterlace, Deinterlace and IVTC.
Also how do I filter the sections differently and then put them together? This is an advanced topic! Thanks for the help though.
I just found this in the Decomb FAQ:
I get "ghosting" on my deinterlaced frames.
Most of the time, ghosting is caused by using blend deinterlacing. Refer to the question on blending versus interpolation. To get rid of ghosting, set blend=false.
Another possible cause is having the field order set wrongly together with postprocessing being enabled. Follow the procedure described in the tutorial to correctly set the field order.
I guess I just add the blend=false in here?
FieldDeinterlace(blend=false)
SUCCESS!!! I added that and the credits look fine! Now I need to figure out how to filter them separately and then stitch them together, because the blend=false makes the actual TV show show an extra frame of colors when their is movement, like red and purple.
So I guess the interlacing is different during the credits as you have said before.
Another Update: I can probably tell one filter to work from a frame range and the other from the other range.
Yet another update, for the rest of the video without deinteralacing I see 3 frames properly then 2 frames that are combed and ghosted, in movement. I see this patern repeating. I guess I would have to tell Decomb to interlace in a specific way. Sample coming up...
Update 3: Sample here: Go frame by frame and watch the box.
http://studentpages.scad.edu/~wceden20/box_movement.zip
Update 4: I figured out how to remove that extra frame from deinterlacing! Using Decimate() But I am afraid this will screw around with the frame rate. I will encode it and see.
Update 5: The encoding looks fine in terms of frame rate. Alright I need Decimate() for the main show and Decimate(mode=1,threshold=1.0) for the credits. Through testing, this seems to be the magic parameters I need to get this working. Does anyone know how to do two different filter setups in StaxRip on different parts of the video?
So I am doing this right foxyshadis?
iantri
16th February 2006, 15:55
okay i looked at your box sample clip.
Pretty standard for NTSC TV -- it's telecined film, presumably edited on video (since according to others the credits are straight interlaced; i'm assuming since it would take far too long on dialup for me to download video :P).
First off, regarding the blended credits; you are seeing this because you're using a very simple deinterlacer that just blends the two fields together; when there is a lot of motion it is obvious.
Secondly, simply deinterlacing this video will produce poor results since the bulk of it is film,so you will have a cycle of (after deinterlacing) 3 clean and 2 blended frames. Instead of simply decimating this you should use Telecide for maximum quality (it matches the fields together properly).
Download LeakKernelDeint and Use a script like this:
mpeg2Source(blah)
Telecide(order = 1, guide = 1, post=1, hints=true) # order = 1 for TFF
LeakKernelDeint( order = 1 ) # ditto
Decimate( mode = 3)
That is the best you're gonna be able to pull off for the video -- frame rate has to be one or the other, 23.976fps (film rate) or 29.97fps (video rate). If you keep it at 29.97fps (i.e. no Decimate) film sequences will look jerky as there are repeated frames. If you decimate to 23.976fps the video parts (i.e. credits and maybe SFX shots) must be converted down by either dropping 1 in every 5 frames or blending 5 frames into 4. The "mode" setting of Decimate controls this; I've told it to do to blend down the video segments for the smoothest possible result. In the end, you end up with film segments at their native frame rate and video segments blended as smoothly as possible to 23.976fps.
Using LeakKernelDeint will help reduce blending nastyness as it is a motion compensated deinterlacer so each individual video frame (before Decimate blends them down to 23.976fps) should be nice and clear.
jmac698
16th February 2006, 16:05
Hello, my problem is about the same. I will try to use some of these techniques.
This is a (probably, as BBC) pal-land source on ntsc. Possibly film -> pal -> ntsc.
Anyhow, it goes like this:
progressive, progressive, top field blending with previous field, top field blended with previous field, bottom field blended with previous field, bottom field blended with previous field, and repeat.
Just to be clear, when the top field is blended, the bottom field is fine. I think it comes out top field first so by previous field I mean, when the top field is blended then it must be blended with the previous frames' bottom field. And when the bottom field is blended, the top field is fine. I could live with just interpolating the non-blended fields.
Smartdeint works great - for four frames. Then there's two frames of blending. At full speed, you don't notice the blending so much but what bugs me is the judder (?) on pans. Movements are very jerky.
My ultimate goal is to restore this to 24fps with ntsc pulldown flags.
Even if I could manually specify the pattern of bad frames I could fix it by hand. I think some of the advanced processing options will change the phase of the smartdeint - in other words maybe the two bad frames are in another spot, so if I could somehow alternate the settings every 6 frames?
I've read about restore24() (which I've been unable to download anywhere), but it's meant for pal->ntsc and might not work for me. I'm pretty sure I could recover the blending with simple arithmetic (with some little amount of ghosting). Any ideas?
iantri
16th February 2006, 17:32
Hello, my problem is about the same. I will try to use some of these techniques.
This is a (probably, as BBC) pal-land source on ntsc. Possibly film -> pal -> ntsc.
Anyhow, it goes like this:
progressive, progressive, top field blending with previous field, top field blended with previous field, bottom field blended with previous field, bottom field blended with previous field, and repeat.
Just to be clear, when the top field is blended, the bottom field is fine. I think it comes out top field first so by previous field I mean, when the top field is blended then it must be blended with the previous frames' bottom field. And when the bottom field is blended, the top field is fine. I could live with just interpolating the non-blended fields.
Smartdeint works great - for four frames. Then there's two frames of blending. At full speed, you don't notice the blending so much but what bugs me is the judder (?) on pans. Movements are very jerky.
My ultimate goal is to restore this to 24fps with ntsc pulldown flags.
Even if I could manually specify the pattern of bad frames I could fix it by hand. I think some of the advanced processing options will change the phase of the smartdeint - in other words maybe the two bad frames are in another spot, so if I could somehow alternate the settings every 6 frames?
I've read about restore24() (which I've been unable to download anywhere), but it's meant for pal->ntsc and might not work for me. I'm pretty sure I could recover the blending with simple arithmetic (with some little amount of ghosting). Any ideas?
Not sure, but it's totally unrelated to the parent post; they have a very very standard NTSC telecine pattern.
Gargantula
18th February 2006, 08:09
I get the error "Telecide does not have a named argument 'order'" Are you sure order is the right parameter?
Are you sure it is not AssumeTFF().SeparateFields()? I see in the reference manual that this is needed to specifiy the field order.
Thanks for the help!
manono
19th February 2006, 12:41
Gargantula-
You're correct in that the newest Decomb no longer needs an order specified for Telecide. So, if it's TFF, precede the Telecide line with AssumeTFF() and leave out the Order=1 inside Telecide. Don't separate the fields.
jmac698-
iantri is correct in saying that your post isn't directly related to the subject of this thread. However, all the BBC R1 DVDs I've seen use PAL masters for the NTSC DVDs, as you guessed. No regular IVTCs work with them. However, the RePAL filter does a good job on them. Use it like this:
TDeint(Mode=1)#or LeakKernelBob(Order=1)
RePAL()
It'll give you a framerate of 24.975fps. Afterwards, if for NTSC DVD, use DGPulldown with the Custom box checked and 24.975->29.97fps. Either that or slow both the video and audio to 23.976fps if you prefer, and then run a regular pulldown if for DVD.
You can get the RePAL and LeakKernelDeint filters here:
http://www.avisynth.org/warpenterprises/
You can get the latest TDeint here:
http://forum.doom9.org/showthread.php?t=82264
jmac698
19th February 2006, 23:18
Thanks, that totally worked. Just gotta know the right person to ask :)
The result is fairly clear, awesome bobber. Would still be interesting to try the deblend approach, but this is certainly practical.
http://rapidshare.de/files/13662957/sample.avi.html
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\rePal.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TDeint.dll")
AVISource("C:\sample.avi")
TDeint(Mode=1,order=1)#or LeakKernelBob(Order=1)
RePAL(quality=3)
Gargantula
25th February 2006, 01:45
Oh my goodness, so far so good! Thanks to both of you! It seems like this encode will do it for the video, the credits is a mess though. This proves that the credits are indeed diferent. I'm still trying how to do two different AviSynth Setups in StaxRip and then merge them without re-encoding.
Geesh, this is complicated, I wonder how you guys know how to do this?!
iantri
25th February 2006, 16:12
No need for two seperate scripts. You can operate like this:
source = AviSource("file.avi")
show = source.Trim(0,97000) # to end of show
credits = source.Trim(97001, 98000) # credits
show = filter()
show = anothefilter()
show = etc()
credits = blah()
credits = blahblah()
credits = etc()
return show ++ credits
.. but keep in mind that the framerate must be the same for the entire file, meaning that either the show will look jerky/blended or the credits will. IMHO, the Telecide solution I posted is about the best you're gonna be able to do with this one.
Gargantula
1st March 2006, 20:02
Thanks! I'll try it now. I'm afraid the audio will be off though using this method in StaxRip. The preview window in StaxRip says "Splice: video framerate doesn't match".
Should I use Adaptive Multiple Consecutive for bidirectional encoding, Quarter Pixel Search or Global Motion Compensation?
How come TVs show the programs alright, when all of these weird interlacing methods and fps are used?
iantri
2nd March 2006, 04:02
It says that because you are still trying to keep the credits at video framerate and the main part at film framerate.
It simply cannot be done in an AVI. The whole file must be at the same framerate, which is why I continue to reccomend simply using my script, as it will output the file at film framerate, blending the 29.97fps credits as smoothly as possible down to 23.976fps.
WRT to encoding settings, that's not something that I can comment much on since it has nothing to do with AVISynth but generally speaking whichever option makes it go the slowest is going to give you the best results (the obvious tradeoff being the speed).
TV's show it correctly because it is transmitted/stored at 29.97fps interlaced; the film segments (which natively runs at 24fps) are telecined into 59.94 fields by repeating the frames of the film into the video's fields in a 2:3 pattern.
Nothing weird about it at all, very standard stuff actually -- consider yourself lucky you don't have to deal with video that is more exotic, like much anime :P
Take a look at 100fps.com for some explanations of telecine and such if you are not familiar with it.
Gargantula
3rd March 2006, 23:22
Do I add the script together like this? Is this what you mean? Because when I used this template is how I got the error. I incorporated your old script into this one.
mpeg2Source(blah)
source = AviSource("file.avi")
show = source.Trim(0,97000) # to end of show
credits = source.Trim(97001, 98000) # credits
show = Telecide(order = 1, guide = 1, post=1, hints=true) # order = 1 for TFF
show = LeakKernelDeint( order = 1 ) # ditto
show = Decimate( mode = 3)
credits = blah()
return show ++ credits
iantri
7th March 2006, 14:21
heh no sorry my bad
drop the mpeg2source() line, you would use that if your source came from an MPEG file (and you would put it in the script in place of AVISource)
the credits = blah() thing was in reference to deinterlacing with a smartbobbing deinterlacer of your choice ("blah") but I wrote that when I didn't know it was telecined material. in this case it isn't to be used because we are decimating down to film. LeakKernelDeinit() is being used as a deinterlacer to post-process the interlaced frames left over from the ivtc process.
This is a complete script that should work, (untested):
AviSource("file.avi")
Telecide(order = 1, guide = 1, post=1, hints=true) # order = 1 for TFF
LeakKernelDeint( order = 1 ) # ditto
Decimate( mode = 3)
Now a thought just occured to me; if you /REALLY/ want to get fancy and you can manually segment off the video parts in the source (i.e. the credits) you could do a motion estimated framerate conversion on the video parts to bring them down to film frame rate. Of course, it's a lot of trouble to go to just to get the credits to run smooth -- and there can not be any telecined material mixed in with the segment you run this on or it will botch the result badly. Nevertheless...
source = AviSource("file.avi")
show = source.Trim(0,97000) # to end of show
credits = source.Trim(97001, 98000) # credits
show = Telecide(order = 1, guide = 1, post=1, hints=true) # order = 1 for TFF
show = LeakKernelDeint( order = 1 ) # ditto
show = Decimate( mode = 3) # show is now 23.976fps
credits = LeakKernelBob(order = 1) # produces 59.94fps deinterlaced
credits = MotionProtectedFPS(23.976) # reduce to 23.976fps with motion estimation
return show ++ credits # the return function tells Avisynth what to output or "return" to the program requesting video, we can output the two combined together because they are the same frame rate now.
Of course you will need the Motion package (search the forum for "MotionProtectedFPS") and you need to change the values in the Trim commands so the credit section is trimmed properly. (The numbers i picked were totally random, I don't have your video to look at)
Gargantula
7th March 2006, 22:58
I think I found the MotionProtectedFPS even after searching the web and forum. The one inside the Mkv Magic 0.95 zip file and the author said that MaskTools.dll is also needed. Is it this? Motion_12Dec05.dll? I found that I needed the script with the function to call upon MotionProtectedFPS.
It is encoding now and will take a long time. I will post the results here. I also see combing artifacts and blurring problems again in the preview window, but fear not as I think it is that StaxRip doesn't recognize the variables show and credits for the preview window.
I knew that blah() what just a placeholder, I didn't really know what to type. All I did before was a FieldDeinterlace(blend=false). Also, I figured what to put for the frame numbers, especially since StaxRip now has the ability to copy fram numbers from the show and paste them where need be. Very handy!
Here is my exact script that I am using: Any bugs?
MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v")
source = MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v")
show = source.Trim(3526,23938) + Trim(28476,49369)
credits = source.Trim(49370,50721)
show = Telecide(guide=1,post=1,hints=true)
show = LeakKernelDeint(order=1)
show = Decimate(mode=3)
credits = LeakKernelBob(order = 1)
credits = MotionProtectedFPS(23.976)
return show ++ credits
Crop(12,0,-8,-4)
LanczosResize(512,384)
Thanks for your help!
Click here to the link to the MotionProtectedFPS script for anyone who searched this thread for it. (http://forum.doom9.org/showthread.php?p=747288#post747288)
iantri
8th March 2006, 15:06
Close, but not quite.
The first MPEG2Source is extraneous. When not explicitly stated, anything you do in Avisynth is done to the Last variable so a line with just MPEG2Source() is equivilent to last = MPEG2Source(). Last is returned by default. (If that helps you understand why things normaly work the way they do).
I've never tried, but I suspect that because of the way you've written things it is being interpreted like this..
last = MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v")
source = MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v")
show = source.Trim(3526,23938) + Trim(28476,49369)
credits = source.Trim(49370,50721)
show = Telecide(guide=1,post=1,hints=true)
show = LeakKernelDeint(order=1)
show = Decimate(mode=3)
credits = LeakKernelBob(order = 1)
credits = MotionProtectedFPS(23.976)
return show ++ credits
last = Crop(12,0,-8,-4)
last = LanczosResize(512,384)
.. and it is implicitly returning "last" because it is the last clip variable operated on. This has the unfortunate effect of totally bypassing all the filtering. This would make sense as to why you are seeing combing and blurring -- None of the processing (except for that on the "last" clip) is taking place. Rewrite it like this:
source = MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v")
show = source.Trim(3526,23938) + Trim(28476,49369)
credits = source.Trim(49370,50721)
show = Telecide(guide=1,post=1,hints=true)
show = LeakKernelDeint(order=1)
show = Decimate(mode=3)
credits = LeakKernelBob(order = 1)
credits = MotionProtectedFPS(23.976)
last = show ++ credits
Crop(12,0,-8,-4) # implied to be last = Crop()
LanczosResize(512,384) # ditto
# return last is implicit
Wilbert
8th March 2006, 15:42
source = MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v")
show = source.Trim(3526,23938) + source.Trim(28476,49369)
credits = source.Trim(49370,50721)
show = Telecide(guide=1,post=1,hints=true).LeakKernelDeint(order=1).Decimate(mode=3)
credits = LeakKernelBob(order = 1).MotionProtectedFPS(23.976)
show ++ credits
Crop(12,0,-8,-4) # implied to be last = Crop()
LanczosResize(512,384) # ditto
# return last is implicit
I don't understand why you use LeakKernelDeint(order=1) though. Telecide(guide=1,post=1,hints=true).Decimate(mode=3) converts hybrid stuff to FILM. Are you sure your source is hybrid?
Gargantula
8th March 2006, 22:00
The original script didn't work at all , the whole thing (no cuts) was encoded, the size is wrong and the interlacing is apparent, I'll try the new one you posted.
I don't think StaxRip knows how to handle all of these advanced fuctions and variables.
Using StaxRip I needed to define the source explicitly. I kept getting errors so I fixed it up to this now.
What program do you use to run these scripts?
MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v")
show = MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v").Trim(3526,23938) + Trim(28476,49369)
credits = MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v").Trim(49370,50721)
show = Telecide(guide=1,post=1,hints=true)
show = LeakKernelDeint(order=1)
show = Decimate(mode=3)
credits = LeakKernelBob(order = 1)
credits = MotionProtectedFPS(23.976)
last = show ++ credits
Crop(12,0,-8,-4)
LanczosResize(512,384)
Wilbert
8th March 2006, 22:42
The script you posted doesn't work. It's equivalent with
last = MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v")
show = MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v").Trim(3526,23938) + last.Trim(28476,49369)
credits = MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v").Trim(49370,50721)
show = last.Decimate(mode=3)
credits = last.MotionProtectedFPS(23.976)
last = show ++ credits
Crop(12,0,-8,-4)
LanczosResize(512,384)
That's not what you want, i guess.
What program do you use to run these scripts?
What do you want to encode it to?
Gargantula
9th March 2006, 07:10
What do you mean it doesn't work? Where at? StaxRip accepted the script, but it didnt encode correctly. Ugh! You removed these values:
show = Telecide(guide=1,post=1,hints=true)
show = LeakKernelDeint(order=1)
Why? Won't it mess up that I got?
Also, what do you mean by "That's not what you want, i guess."
Is "last" a predefined variable by AviSynth?
I want to encode to avi with DivX 6.1.1. StaxRip doesn't support variables for now I guess.
iantri
9th March 2006, 19:28
Wilbert:
I don't understand why you use LeakKernelDeint(order=1) though. Telecide(guide=1,post=1,hints=true).Decimate(mode=3) converts hybrid stuff to FILM. Are you sure your source is hybrid?
That Telecide(post=1, hints=true).LeakKernelDeint(order=1) was for post-processing any frames that remained combed and could not be matched, instead of using Telecide's internal (equivilent to FieldDeinterlace) deinterlacer.
It seemed to me initially that Telecide's post-processing should be disabled, but that is the way the KernelDeint docs indicate it should be used.
WRT to Decimate(mode=3), I can't be sure of the content of his show but I'm guessing given that the credits are video, there may be some hybrid content inside the main part of the show (which is appearantly film). A bit of safety to give the smoothest result in case.
And with respect to the script I posted not working, well, what can I say, I'm an idiot :P
What do you mean it doesn't work? Where at? StaxRip accepted the script, but it didnt encode correctly. Ugh!
Hence, it didn't work :P
I don't think StaxRip knows how to handle all of these advanced fuctions and variables. What program do you use to run these scripts?
Gargantula, I think you might want to read up on how AviSynth works; StaxRip has no part in dealing with the script, it simply generates an AVS file and opens it -- causing AviSynth to parse the file and frameserve to it. Internally, StaxRip doesn't really even know that it isn't dealing with a real AVI.
You keep breaking the script by "fixing it."
In AVISynth a clip is a special type of variable. Filtering is done by assigning the result of a plugin's function to a variable. The special variable last exists; when no explicit variable assignment is done, it is assumed to be assigned to last.
Therefore
Foo()
Bar()
is equivilent to
last = Foo()
last = last.Bar()
Of course as has been clearly demonstrated, I am not the best person to be asking about how AviSynth works :P Now, keeping that in mind you can see why my script and your script do not work as Wilbert has pointed out.
This /should/ work [knock wood]:
source = MPEG2Source("D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.d2v")
show = source.Trim(3526,23938) + source.Trim(28476,49369)
credits = source.Trim(49370,50721)
show = show.Telecide(guide=1,post=1,hints=true)
show = show.LeakKernelDeint(order=1)
show = show.Decimate(mode=3)
credits = credits.LeakKernelBob(order = 1)
credits = credits.MotionProtectedFPS(23.976)
last = show ++ credits
Crop(12,0,-8,-4) # implied to be last = Crop()
LanczosResize(512,384) # ditto
# return last is implicit
Gargantula
9th March 2006, 22:58
But in what program should I use it in, since StaxRip doesn't seem to be working. I looked in my Avisyth folder and there is no exe to run.
"You keep breaking the script by "fixing it."
Well, StaxRip wouldn't accept it as it was, so I had to edit it.
Wilbert
9th March 2006, 23:50
You just have to open it in your encoder. In VirtualDub if you are encoding to XviD/DivX, in TMPGEnc/CCE/QuEnc if you are encoding to mpeg1/mpeg2, etc ...
It's always good to open your script in VirtualDub to check whether it is correct or not.
iantri
10th March 2006, 01:34
StaxRip does /NOT/ interpret the script.
There is no EXE to run because AviSynth does not work that way. It transparently intercepts requests for video frames when a program attempts to open an AVS file. To the program, it is dealing with an AVI.
StaxRip would be able to interpret error messages from AviSynth though instead of attempting to process the video it generates in that case(10 seconds of text of the error message)
I have never used StaxRip; but I looked at a screenshot; it seems it has a wizard like interface and an option to enter more scripting commands? Now of course if it does something stupid like dumbly appending to the end of your custom script it is not going to work.
There's not much reason to be using it anyway. Just use virtualdub. You're doing all the processing/editing with AviSynth.
Gargantula
10th March 2006, 05:57
I never used VirtualDub Mod, so where do I put the script? Do I put it in a txt file then rename to .avs and then open the avs with VirtualDubMod? That is what I did and it looks right. What do I do to set the encoding settings etc to run two passes? Also, do I have to copy the plugins for Avisynth to another folder? Right now it is in the default StaxRip folder and is working fine I think because VirtualDub Mod didn't complain.
I am encoding now with this script... Then I will try taking out "show = show.Telecide(guide=1,post=1,hints=true) and show = show.LeakKernelDeint(order=1)" as Wilbert said to see if it changes things, looks better or encodes faster. In the preview window combing artifacts are present, indication that deinterlacing isn't going on at all.
Also, what do I do about the audio not being included? I aborted the dub and just as I thought the audio is missing. I can't use the original mpg either. Sigh, I am sorry for causing you guys all of this trouble, this is frustrating, but I will press on.
I found this in the log for StaxRip. Can this be used? This is why I used StaxRip, it helps newbies like me to encode videos easily (when it works).
---------- Audio Encoding ----------
Command Line: "C:\Program Files\StaxRip\Applications\BeSweet\BeSweet.exe" -core( -input "D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0.mp2" -output "D:\Recording\SageTV\Temporary Encoding\Unfabulous-TheCharityCase-5802814-0_AudioOutput.mp3" ) -azid( -c normal -L -3db ) -ota( -d 0 -hybridgain ) -lame( -v --vbr-new -V 5 )
---------- Audio Encoding Statistics ----------
Start time: 9:37:46 AM
End time: 9:40:15 AM
Duration: 00:02:29
Speed: 636 fps
Size: 35.5 MB
Bitrate: 75.17 kbps
Video Bitrate: 2901 -> 2954
---------- First Pass Codec Parameters ----------
: 06_01_01_01031_Tiger_WinCodec
06_01_01_01031_Tiger_WinCodec: -bvn1 2954000 -vbv 27336400,100663296,75497472 -dir "C:\Program Files\DivX\DivX" -w -pq 8610 -g -b 3 -nf -quantization=2
06_01_01_01031_Tiger_WinCodecArtwork: enabled
---------- First Pass Encoding ----------
VirtualDub.Open("D:\\Recording\\SageTV\\Temporary Encoding\\Unfabulous-TheCharityCase-5802814-0.avs","",0);
VirtualDub.video.SetMode(1);
VirtualDub.video.SetCompression(0x78766964,0,10000,0);
VirtualDub.SaveAVI("D:\\Recording\\SageTV\\Temporary Encoding\\Temporary Files\\Unfabulous-TheCharityCase-5802814-0_FirstPass.avi");
---------- First Pass Encoding Statistics ----------
Start time: 9:40:15 AM
End time: 9:48:39 AM
Duration: 00:08:24
Speed: 188 fps
---------- Single, Second or NTh Pass Codec Parameters ----------
: 06_01_01_01031_Tiger_WinCodec
06_01_01_01031_Tiger_WinCodec: -bvnn 2954000 -vbv 27336400,100663296,75497472 -dir "C:\Program Files\DivX\DivX" -w -pq 8610 -g -b 3 -nf -quantization=2
06_01_01_01031_Tiger_WinCodecArtwork: enabled
---------- Single, Second or NTh Pass Encoding ----------
VirtualDub.Open("D:\\Recording\\SageTV\\Temporary Encoding\\Unfabulous-TheCharityCase-5802814-0.avs","",0);
VirtualDub.RemoveInputStreams();
VirtualDub.video.SetMode(1);
VirtualDub.video.SetCompression(0x78766964,0,10000,0);
VirtualDub.stream[0].SetSource("D:\\Recording\\SageTV\\Temporary Encoding\\Unfabulous-TheCharityCase-5802814-0_AudioOutput.mp3",0x00000202,1);
VirtualDub.stream[0].SetMode(0);
VirtualDub.SaveAVI("D:\\Recording\\SageTV\\Temporary Encoding\\Unfabulous-TheCharityCase-5802814-0.avi");
---------- Single, Second or NTh Pass Encoding Statistics ----------
Start time: 9:48:40 AM
End time: 9:48:46 AM
Duration: 00:00:06
Speed: 15107 fps
---------- Overall Statistics ----------
Start time: 9:37:46 AM
End time: 9:48:46 AM
Duration: 00:11:00
By the way I ran the script in StaxRip without the variables on the video to see if it comes out alright and there is some jerkiness in the main show in one part where two scences push as a transition, like in powerpoint. The credits of course look horrible, it is definitely different.
As a note. When I play the original mpg in WMP, no interlacing is done. In MP CLassic deinterlacing is done, but there is the issue of ghosting in two frames after 5. Also, the credits are blurred. In Nero Showtime, is is perfect! Even the transition. I wonder how Nero Showtime2 is deinterlacing it, I gotta do that! In the options it has an option called Adaptive deinterlacing the the threshold is right in the middle.
iantri
10th March 2006, 18:47
In Media Player Classic you're very likely getting whatever deinterlacing method the DirectShow filter that is rendering the MPEG video does; probabably a simple blend deinterlace.
In Nero Showtime it is likely doing it's own, probably a motion-adapted bob.
LeakKernelBob does this but what you aren't accounting for is that because film material is put into video by repeating it on alternately 2 or 3 fields, you will end up with a finished video file that is 60fps that stutters slightly as each film frame will repeat 2 or 3 times. (60/24).
Oh, and the lack of audio is due to the fact that DGIndex does not handle audio; you must demux the audio (set under the Audio.. menu in DGIndex) and then mix it back in with AviSynth. (I am assuming StaxRip deals with this).
Grab MPASource plugin and add after the MPEG2Source line;
audio = MPASource("blah.mpa") #wherever DGindex dumped it)
source = source.AudioDub(source,audio)
Taking out the Telecide line is just going to screw things up. The whole point of it is to find and match the fields that go together from the telecine process. LeakKernelDeint is being used to post-process and decomb the frames that could not be match (and hence are still interlaced), and Decimate reduces the framerate to 23.976fps by deleteing the duplicated frames that are left over after the fields are matched together.
btw, try adding an explicit return last. I had to, to make it work -- I just tested it on my end.
If you are seeing combed frames in anyway there is a problem with the script.
I am not having such a problem when I test it.
Gargantula
16th March 2006, 09:18
So I open the mpg in DG Index?
StaxRip dumped a mp2 file from the original mpg. Can I use that instead? In addition, StaxRip automatically runs DG Index when opening a new file, but I do not see an mpa file anywhere. Will the trim settings affect the audio correctly as well?
When you said "btw, try adding an explicit return last. I had to, to make it work -- I just tested it on my end." you mean to have "return last" as the last line in the avs script?
I am working on another video and it has a 3:2 NTSC pulldown method of interlacing, but then swtiches to 2:2 about every 3 sycles of 3:2. So annoying! I wish everything was progressive already!
foxyshadis
16th March 2006, 09:36
m2v and m1v are raw mpeg video. mp2 is raw mpeg audio, which can also be mpa, ac3, dts, lpcm/wav. Can't remember if mpasource opens mp2s, I think they might be the same thing, but I'm sure something in NicAudio does. But you still need the d2v from dgindex.
Gargantula
7th April 2006, 01:30
I'm alive :-), I just went on Spring Break and decided to try fixing this again and get it right. Ugh! I have many unencoded mpg2s clogging up my hard drive since I have so many issues converting them to clean divx codec files.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.