View Full Version : Any chance somebody could check out my script ?
ChrisW77
30th November 2006, 01:51
I have been reading everything on this forum, using the search, and reading a LOT of great info from people.
I'm still learning this, but I finally have my first script. It's a test script for restoring some old PAL UK shows from the late 80's.
I'm just wondering if I could get some opinions from some of the folk here.
I have hooked up a VHS deck to a DVD recorder, and recorded some shows in high quality mode at 720x576. Then, ripped the vobs to my HD, ran them through DGIndex to create the d2v file.
#test script
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mpasource.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DeGrainMedian.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Convolution3d.dll")
video = mpeg2source("D:\DVD\adverts\test1.d2v", iPP=true, idct=5)
audio = MPASource("D:\DVD\adverts\test1 T01 DELAY -384ms.mpa", normalize = false)
AudioDub(video, audio)
ConvertToYUY2(interlaced=true)
AssumeTFF()
parity = GetParity() ? 1 : 0
LeakKernelDeint(order=1,threshold=10,sharp=true)
Crop(12,4,-16,-10) # Left,Top,Right,Bottom.
addBorders(14,7,14,7) # Left,Top,Right,Bottom.
LanczosResize(512,384)
DeGrainMedian(limitY=5,limitUV=10,mode=1,interlaced=false)
DeGrainMedian(limitY=5,limitUV=10,mode=2,interlaced=false)
DeGrainMedian(limitY=5,limitUV=10,mode=5,interlaced=false)
Convolution3D (0, 32, 128, 16, 64, 10, 0)
ConvertToYV12
TweakColor(sat=0.7,bright=0.6) #Colour tweaking.
Does that look ok ?
I know thats a lot of filtering, but the source is very noisy. I served the script to vdub, done a 2-pass xvid, and it looks pretty good.
A few questions
Is it better (in anyone's opinion) to filter after you deinterlace, crop, resize ?
or Is it better to filter first, then deinterlace, crop, resize ?
I was wondering if the deinterlacer is smart enough to tell the difference between interlacing, and noise ? Hence the above question about filter after deinterlacing.
Should I use the addborders function ?
Or just crop, then resize what you are left with. I was thinking about overscan, for the few members of my family that still use CRT TVs.
Is it wise to use 2 colour conversions ? I have use YUY2 for Convolution3D, but found that adding YV12 at the end produced a slightly nicer looking colour.
Sorry for so many questions, but I'm still new to all this :D
Any help, most appreciated.
Blue_MiSfit
30th November 2006, 01:54
It's hard to comment on the script without seeing the source. Maybe you can post a small VOB sample somewhere?
ChrisW77
30th November 2006, 03:24
Bit difficult at the moment, as I don't have anywhere to put it.
The source is basically a few VHS tapes, some SP, some LP, from around the late 80's to the early 90's, and very noisy, especially the LP tapes with lots of dot crawl causing a sort of wobbly picture.
I know thats not a lot to go on, but thats all I got so far.
check
30th November 2006, 09:18
Some sort of source is important, comments otherwise comments can only be generalities. If you want some of those:
Instead of running 3 DGM, have a look at removegrain. That has a huge number of modes, and also works well chained.
As for C3d, I'd recommend you stick with the presets. try vhsBQ.
ChrisW77
30th November 2006, 12:43
Ok, I have uploaded a advert I found, inbetween the programs I'm doing.
http://rapidshare.com/files/5436820/test.advert.mpg
It's a 16Mb mpeg2 file.
Please ignore the poor sound, I usually process the sound separately.
ChrisW77
30th November 2006, 17:21
Is noone going to help, then ?
I've pretty much hit a brick wall, and would appreciate some help, thanks.
rfmmars
30th November 2006, 18:08
Is noone going to help, then ?
I've pretty much hit a brick wall, and would appreciate some help, thanks.
I do a lot of this, I will look and test.
Richard
photorecall.net
LogicDeLuxe
30th November 2006, 23:25
Apparently the recording has too much noise for the dvd recorder to be able to record it properly. It introduced pulsing noise, hard to filter.
Furthermore, the levels are clipped. If you're lucky, you can adjust the contrast on your dvd recorder.
Though, you should consider using a video capture card instead. With it you can capture lossless and noise filters should work much better.
If your video should be played back on CRT TV, you should keep the overscan as it is. Crop and Addborders is okay, though you should do this only in even numbers when in some YUV mode.
ChrisW77
1st December 2006, 00:20
Thanks for the input, I really appreciate any help.
A couple of things though,
I'm a married man, with 2 energetic kids, a full-time job, and the wife. Capturing via a analogue capture is out of the question, at this time. 10Gb+, for 30+ mins of capture, just isn't an option for me, as I have 50+ VHS tapes to go through.
The DVD Recorder, is a quick, and easy option for me to get these shows on DVD, and get rid of upto 50+ old VHS tapes, as part of a major clearout. I then have the shows on DVD to mess with in my own time.
I know there is already a first stage of compression, via mpeg2, but what I need to know is, Is there anything I can do to the shows I already have done ?
And more importantly, as I'm still learning this, Is my script ok ?
THATS, what I'm more interested in, as I can learn from my own mistakes, and take notes from those who are more advanced at this than me.
Please, if we could ignore the shortcomings, and concentrate on what I have at this given time.
And, thanks for ANY input.
juhok
1st December 2006, 00:54
You could record it in higher quality mode to have more bits to work with (if all the 50 tapes aren't done yet). Now it averages at pretty constant 4.4Mbps which is about half of what it could be. My 2c.
ChrisW77
1st December 2006, 20:35
Thanks for nothing.
I thought this was meant to be a friendly place, obviously not.
Noobs to video, aren't welcome, then ?
I see everyone else gets help, but who cares about me, eh ?
All I wanted was some help. I guess I'm not one of the chosen few, here, and I certianly don't feel welcome, at all.
What annoys me is that, this place has a monopoly on the best video programs out there, so there's nowhere else to go to get help.
I guess, some of you experts, Cherry-Pick your answers, and love to ignore ones who aren't up to your "Expert" standards.
Sorry for even bothering.
LockoNH
1st December 2006, 22:20
You have to give them time to respond! A lot of people would look at something like this and respond sometime during the week if they have time. I'd help you, but I'm a noob as well.
rfmmars
1st December 2006, 23:53
You have to give them time to respond! A lot of people would look at something like this and respond sometime during the week if they have time. I'd help you, but I'm a noob as well.
Yes the same here, I run a video studio with 5 workstations running 24/7. Its here where we all take our break.........take it easy, we will get back to you.
EDIT:
#test script
AVISource("e:\1.vdr.avi")
LoadPlugin("E:\avs\plugins\DGDecode.dll")
LoadPlugin("E:\avs\plugins\mpasource.dll")
loadplugin("E:\avs\plugins\DeGrainMedian.dll")
LoadPlugin("E:\avs\plugins\Convolution3d.dll")
#video = mpeg2source("E:test1.d2v", iPP=true, idct=5)
#audio = MPASource("D:\DVD\adverts\test1 T01 DELAY -384ms.mpa", normalize = false)
#AudioDub(video, audio)
ConvertToYUY2(interlaced=true)
AssumeTFF()
parity = GetParity() ? 1 : 0
#LeakKernelDeint(order=1,threshold=10,sharp=true)
Crop(12,4,-16,-10) # Left,Top,Right,Bottom.
addBorders(14,7,14,7) # Left,Top,Right,Bottom.
LanczosResize(512,384)
DeGrainMedian(limitY=5,limitUV=10,mode=1,interlaced=false)
DeGrainMedian(limitY=5,limitUV=10,mode=2,interlaced=false)
DeGrainMedian(limitY=5,limitUV=10,mode=5,interlaced=false)
Convolution3D (0, 32, 128, 16, 64, 10, 0)
ConvertToYV12
Tweak(sat=0.7,bright=0.6) #Colour tweaking.
return last
We all use "Avisynth" differetly so you will see some of your script null out.
There are two basic mistakes that I found, its not TWEAKCOLOR but TWEAK
& an error on
LeakKernelDeint(order=1,threshold=10,sharp=true)
I like the smoothing and I would add "DeHalo" for the overshoot.
E-mail me at rfmmars@cox.net to see what can be done using HDRagc
Richard
ChrisW77
2nd December 2006, 02:06
Richard, why did you hash-out some of my script ?
The reason I ask, is because I would like you to explain each line you hashed-out, so I can understand, and learn more.
LeakKernelDeint(order=1,threshold=10,sharp=true)
What was my error in that line ?
I was under the impression that, Order=1 is for TTF ? Threshold=10 is about the right value between detail loss, and almost zero interlacing ? sharp=true is simply to end up with a slightly sharper image, rather than a slightly soft image.
I would add "DeHalo" for the overshoot.
Is there any Halo problems that I'm missing ?
What I'm understanding, in my limited way, is this
video = mpeg2source("D:\DVD\adverts\test1.d2v", iPP=true, idct=5)
load the d2v file, after using dgindex, Field-Based Post-Processing, and CPU to use SSE2
audio = MPASource("D:\DVD\adverts\test1 T01 DELAY -384ms.mpa", normalize = false)
I process the audio separately, but I need this line to save the audio, at my cut points, without any further compression. I can then work on cleaning up the wav file, and mux later on.
AudioDub(video, audio)
To be able to hear audio, when playing back in vdub. Without this line, I get a video error in vdub.
ConvertToYUY2(interlaced=true)
Needed for C3D, while the video is interlaced.
AssumeTFF()
Tested using the method where you separate fields, and step forward each frame to see if the motion is fluid, and not jumpy.
parity = GetParity() ? 1 : 0
Not too sure what this is, or if it's needed. I was under the impression that it automatically gets the parity ?
Crop(12,4,-16,-10) # Left,Top,Right,Bottom.
addBorders(14,7,14,7) # Left,Top,Right,Bottom.
Crop out the noisy overscan, and add back borders to work with original frame size, and add overscan for CRT TVs.
LanczosResize(512,384)
A good frame size for VHS ? Able to get a good bits/pixel + high bitrate, and a good file size from xvid 2-pass ?
DeGrainMedian(limitY=5,limitUV=10,mode=1,interlaced=false)
DeGrainMedian(limitY=5,limitUV=10,mode=2,interlaced=false)
DeGrainMedian(limitY=5,limitUV=10,mode=5,interlaced=false)
Convolution3D (0, 32, 128, 16, 64, 10, 0)
Mode=0, didn't seem enough, but mode=0 + other modes = too much smudging of human faces. limitY=5 to limit pixel luma correction, which makes up for a lot of VHS noise ? Left limitUV to default, and interlaced=false as video is now deinterlaced.
ConvertToYV12
TweakColor(sat=0.7,bright=0.6) #Colour tweaking
The conversion to YV12, at this stage, seemed to produce better colour ? Maybe just me. And the Tweakcolor, I can just use the word Tweak ?
As you can see, I'm learning, and trying, at the same time.
The above, is just my own understanding, and probably not right.
I'm frustrated, because I don't get much time to myself to do this video work. Having 2 kids, a wife who's fairly tolerant of the PC, and a full-time job, means I have to use my spare time.
Currently, I have this weekend, and thats it until the christmas holidays, where I'll be lucky if I get a few hours per day to finish this.
Sorry for the outbusrt, but it's VERY frustrating.
Blue_MiSfit
2nd December 2006, 07:49
We all use our spare time :) I'm in the middle of a job hunt so it's been all my time recently, but fear not, a solution will be found! :)
IMO, capturing to a lossless file would be a good idea. At this rate you are: VCR->DVD (realtime), then DVD->XviD (faster than realtime but still slow with your script).
It's the same speed to replace VCR->DVD with VCR->Lossless->XviD, and it will give you much higher quality.
Maybe this is not the case, but I think it would be easier this way. No wasting your DVDs that way too :)
~MiSfit
foxyshadis
2nd December 2006, 10:51
Instead of chaining DeGrainMedian, fft3dfilter might be a better choice, especially since you can individually control the frequency strengths, and apply a little sharpening. Alternately, mvdegrain, although slower, can generally help a lot more. Personally I prefer something like Vaguedenoiser over C3D, but that's up to you. Due to the nature of VHS, however, once you get rid of the noise, you'll have... well, not much left, and it might look a little empty. Depending on the quality of the capture, you might want depan to stabilize it.
Without this line, I get a video error in vdub.
This is because you haven't assigned anything to the default clip at this point. You could have a line that just says "video", or simply not assign the mpeg2source to anything, and it'd work. (In most cases carrying the audio with the video isn't a bad idea though.)
Although I agree in principle with the VHS->lossless, in reality, your VHS deck is going to introduce more problems than the DVD will, and DVD can usually store VHS at around 5mbps without much loss.
ChrisW77
2nd December 2006, 12:42
Thanks for the help, so far.
At this point in time, it's not a solution to use a capture card.
No PC exists near the VHS equipment, which would require another PC, as the whole family enjoy the only one PC I have.
On the DVD recorder, I'm using the 5mbps 720x576 mode. There is a 9mbps mode, but you only get 1 hour per tape.
I pay only 15p each per DVD, so popping in a VHS tape, ready to go, you get to leave it recording for 2 hours, to get on with other things. 15p, ain't a waste, at the moment, as it's more of a nicer convenience.
The main reason for all this, is that most of these tapes contain old family footage, and a few old TV shows that haven't made a DVD release.
Instead of chaining DeGrainMedian, fft3dfilter might be a better choice, especially since you can individually control the frequency strengths, and apply a little sharpening. Alternately, mvdegrain, although slower, can generally help a lot more. Personally I prefer something like Vaguedenoiser over C3D, but that's up to you. Due to the nature of VHS, however, once you get rid of the noise, you'll have... well, not much left, and it might look a little empty. Depending on the quality of the capture, you might want depan to stabilize it.
If you can find time, could you explain that a bit more, please ?
Would depan stabilize the wobbly picture ?
And, is this whole method better, in anyone's opinion, than this
separatefieids
Do my filtering
weave ?
How about adding CPU=4 or even 6, to this line ?
video = mpeg2source("D:\DVD\adverts\test1.d2v", iPP=true, idct=5
Or, does deblocking cause detail loss ?
Again, sorry for so many questions, but I'm learning every day.;)
foxyshadis
2nd December 2006, 14:00
Working in reverse: Use cpu=4 if you find blocking. Just scope out a hard-to-compress segment, like a noisy fast pan, and if it's crazy blocky use it. If not, no need. The noise removal of 5 or 6 is better left to other filters though.
Are you saving it to the computer for good? Deinterlace. Are you transferring it to DVD? Either separate-filter-weave, or bob-filter-reinterlace (slower but often better quality). This is one of those areas that you can put as much time into as you want in pursuit of perfections, but the source is so noisy that a simple tdeint or leakkerneldeint/bob is likely better. Perhaps with a light interlaced degrainmedian or fft3d beforehand to make deinterlacing a little more accurate.
Yep, depan will lessen the wobbliness, although it sometimes needs some tweaking.
You use fft3dfilter like:
fft3dfilter(sigma=3,sigma2=1,sharpen=.5)
Where sigma2-4 are for lower frequency noise (high frequency being snow or gaussian noise, low being bigger blotches and interference patterns).
Mvdegrain is a denoiser that denoises by realigning neighboring frames before comparing, making it much more accurate than normal temporal filters. It's part of mvtools, and a bit complex, but a couple use examples are given in the docs.
All the latest are available from fizick's site:
http://avisynth.org.ru/fizick.html
He's really an amazing developer.
Unfortunately, home always gives me problems with rapidshare, so I can't tailor a script to any specific issues.
ChrisW77
2nd December 2006, 15:41
Thanks for taking the time out to help me, foxyshadis.
Are you saving it to the computer for good? Deinterlace.
Mostly both, Computer AND standalone DVD player/Divx player. This is because I want to permanently copy my home-made family stuff, to DVD in xvid form, and restore as much as I can. These DVDs, will then be passed around the country to various family members, to keep, some of which I hopefully want to give as a small xmas present to the ones that feature in the footage. I didn't want to just archive the VHS tapes, and make it look as if it was a quick and dirty method of archiving. Rather, make an effort in restoring them.
Perhaps with a light interlaced degrainmedian or fft3d beforehand to make deinterlacing a little more accurate.
Yep, I like that, sounds good.
You use fft3dfilter like:
fft3dfilter(sigma=3,sigma2=1,sharpen=.5)
Where sigma2-4 are for lower frequency noise (high frequency being snow or gaussian noise, low being bigger blotches and interference patterns).
Again, I like the sound of that. I'll give that a try, in a moment.
All the latest are available from fizick's site:
http://avisynth.org.ru/fizick.html
He's really an amazing developer.
He certainly is. I'll have a good look around that site, thanks.
Unfortunately, home always gives me problems with rapidshare, so I can't tailor a script to any specific issues.
Can you recommend a better way to share a file ?
I don't have any webspace yet, or rather had the time to look into it.
The clip is just a advert from the same VHS tape as my footage, as I figured it wasn't copyright material, or contained members of my family.
Thanks for all your help, most appreciated.
I appologise to the mods for my slight outbust, earlier on. Not intentional, I can assure you. More, frustration, brought in by this wierd world of video recording.
rfmmars
2nd December 2006, 17:27
Richard, why did you hash-out some of my script ?
The reason I ask, is because I would like you to explain each line you hashed-out, so I can understand, and learn more.
What was my error in that line ?
I was under the impression that, Order=1 is for TTF ? Threshold=10 is about the right value between detail loss, and almost zero interlacing ? sharp=true is simply to end up with a slightly sharper image, rather than a slightly soft image.
Is there any Halo problems that I'm missing ?
What I'm understanding, in my limited way, is this
load the d2v file, after using dgindex, Field-Based Post-Processing, and CPU to use SSE2
I process the audio separately, but I need this line to save the audio, at my cut points, without any further compression. I can then work on cleaning up the wav file, and mux later on.
To be able to hear audio, when playing back in vdub. Without this line, I get a video error in vdub.
Needed for C3D, while the video is interlaced.
Tested using the method where you separate fields, and step forward each frame to see if the motion is fluid, and not jumpy.
Not too sure what this is, or if it's needed. I was under the impression that it automatically gets the parity ?
Crop out the noisy overscan, and add back borders to work with original frame size, and add overscan for CRT TVs.
A good frame size for VHS ? Able to get a good bits/pixel + high bitrate, and a good file size from xvid 2-pass ?
Mode=0, didn't seem enough, but mode=0 + other modes = too much smudging of human faces. limitY=5 to limit pixel luma correction, which makes up for a lot of VHS noise ? Left limitUV to default, and interlaced=false as video is now deinterlaced.
The conversion to YV12, at this stage, seemed to produce better colour ? Maybe just me. And the Tweakcolor, I can just use the word Tweak ?
As you can see, I'm learning, and trying, at the same time.
The above, is just my own understanding, and probably not right.
I'm frustrated, because I don't get much time to myself to do this video work. Having 2 kids, a wife who's fairly tolerant of the PC, and a full-time job, means I have to use my spare time.
Currently, I have this weekend, and thats it until the christmas holidays, where I'll be lucky if I get a few hours per day to finish this.
Sorry for the outbusrt, but it's VERY frustrating.
I am a beginner like you and to take a look at what your filter script does I change lines simply because I interface to "avisynth" with Virtualdub, not DGindex. I demux my audio in VDdub. So I will get errors when loading.......it has no effect on test.
I listed the error and the wrong code.
Your asking too much from me and others to spend hours to change their setup just to do your a favor.
Richard
*.mp4 guy
2nd December 2006, 17:52
yousendit (http://www.yousendit.com/) Is a pretty good file host (it looks like they email you the link, but they give it to you after you finnish uploading aswell). If you are willing to use a slow script you could get pretty good results.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.