Joe Daring
10th February 2003, 19:36
Hello'"Masters of AVISynth"!!! :-)
Here is my very first post in this Forum... so far I've spent some long hours reading your posts over here, and find them VERY informative, even if sometimes too advanced for a newbie like me...
But I guess that, in a Forum blessed with the presence of so many great developpers, it couldn't be any different than that!
So, why am I boring you with this LONG post?
It is easily said:
I am totally new to the AVISynth world, and starting to use this GREAT program (V2.5 right now) to edit some videos of mine, and to transfer them to SVCD at the moment, and to DVD-r in the future...
I've been digging the Forum for the tricks/info I need, but haven't found them, or found something that gave too much for known and, unfortunately, did not make things clear for me... not your fault, guys, but mine, since I'm a total newbie :-)
I started with tryng to put my Wedding Video on SVCD... and stumbled in some problems... let's see if I can get any help here...
WARNING!!!! Stupid/Easy Questions ahead! Steer clear if this bores you!!! ;-)
OK... the video is a 76 Minutes PAL Video shot 6 years ago with a Pro Sony camera in Beta format...
It has been edited and rendered to a SVHS tape by the Video Service that did the shooting... this is to give you a hint at the overall quality of the material Im'starting with...
I have to say that I expected an overall better quality, given it was handled by a professional service, but can't complain too much, anyway...
I have captured the video with an ATI A.I.W. Radeon 9000and VirtualDub, at 720x576 using the PicVideo MJPEG SoftCodec at maximum quality, and set the codec to capture NON-Interlaced, since after a few experiments I had the feeling that Non-Interlaced caps were a bit better than Interlaced ones, and cropped while capturing at 690x560, to cut some border noise,. Quality of the capture in nothing to sneeze at.
The capture I have on my HD now has some defects that I would like to correct...
Mainly they are:
-A strong PAL color line artifact... you know, thin red/green lines alternated on the video... also, this artifact makes the reds in my video to shift toward purples...
-Every now and again, there are glitches on the video, that are essentially thin gray lines, or couple of such lines, wich affect just one-to-three frames in a row
-There is some noise, but not much,
-Overall Audio level is low,
-Some parts of the audio has a defective Right Channel... Left is always OK.
My AVISynth script so far is this (...But, of course, not everything works :-( ):
============================================
#AVISynth script for Wedding Video Cleanup & convert to PAL SVCD res
#Output should be fed to TMpeg Plus Encoder
#Load necessary AVISynth Plugins...
#LoadPlugin("filename"[,...])
LoadPlugin("C:\Programmi\Video e Grafica\AviSynth\plugins\Convolution3dYV12.dll")
#Load eventual VirtualDub Plugins...
#LoadVirtualDubPlugin("filename","filtername", preroll)
Grafica\AviSynth\plugins\Filename.vdf","Filtername")
#Load Video File...
#AVISource(string filename[,...], bool "audio", string "pixel_type")
Avisource("E:\Temp_Folder\Video_Captures\Wedding_Video.avi")
#================#
#Audio Processing#
#================#
#Removes broken right channel for a portion of video,
#and return good left channel on a mono clip:
GoodAudio1=Trim(0,3144)
BadAudio=Trim(3145,3830).GetLeftChannel
GoodAudio2=Trim(3831,116660)
GoodAudio1+BadAudio+GoodAudio2
#Normalize audio signal to 95%:
Normalize(0.95)
#================#
#Video Processing#
#================#
#Correct levels after checking with VirtualDub's "Level" Filter.
#AVISynth "Level" filter can use the same values supplied by VirtualDub's one...
#Levels(clip, int input_low, float gamma, int input_high, int output_low, int output_high)
Levels(5,1.0,255,0,255)
#Clean-Up some video glitches in frames...
#FreezeFrame(clip, int first_frame, int last_frame, int source_frame)
FreezeFrame(41,41,40)
#More of these FreezeFrame lines...
FreezeFrame(222,224,225)
#More of these FreezeFrame lines...
FreezeFrame(18655,18655,18656)
#This Custom-Function definition should be an AVISynth
#replacement for what "rmPAL" VirtualDub's filter does
#I.E. removing PAL Phase Alternating color artifact.
function rmPAL(clip c) {
c=c.AssumeFrameBased.SeparateFields.AssumeFrameBased
MergeChroma(c,c.BlendFields(),1)
AssumeFieldBased()
return Weave()
}
#Invokes the "rmPAL" function defined above...
rmPAL
#Clean-Up some noise... Alternative noise filter...
Convolution3dYV12(0,32,128,16,64,10,0)
#Resize to PAL SVCD legal size...
#BilinearResize(clip, int target_width, int target_height)
BilinearResize(480,576)
==========================================
So... here are the problems I have with this script:
The Audio processing part for replacing broken Right Channel content with good Left Channel content does NOT work, nor seems I'm able to make it work :-(
best I can, I end-up with a video that has the Right Channel replaced by the Left one FOR THE WHOLE LENGHT of the video, not only for the part that has broken audio, making it virtually MONO... OR, I end-up with a short piece of video that is the part I defined "BadAudio", with the Right Channel correctly replaced by the Left one.
If I try to splice the three parts together, I get an error message complaining that sound formats does not match, maybe because I have a mono piece between two stereo piece....
What can I do? I know I could get the audio in a good audio tool and then audiodub it back in my video, but I would like to know if this trick is doable in AVISynth alone, and I think it is!
The low audio level problem gets cured by the Normalize command I use in my script but, is this the correct way to do it?
Level correction is very subtle, and maybe unnecessary, but it's there since I would like to create a script which would serve me as a general basis for future problems... is that OK?
The "Clean-up some glitches" part is the one stealing me A LOT of TIME. I would appreciate some suggestions... you see I'm basically covering the "Glitched" frames with the previous or following good ones... as far as I can see, there are no adverse effects on motion, since they are just single, double, or triple frames corrections. Problem is, the job is very long and tedious and, worst of all, it will not help me for other captures, since affected frames are capture-specific. Is there any kind of automatic filtering that can be done with any plugin, for this specific defect? I'm afraid the answer will be...NO! But I feel it's worth asking :-)
...and while we are at it... is it possible, with freezeframe or something else, to replace ONLY a portion of a frame (Let's say the lower third...) with the corresponding portion of another good source frame?
The custom function replicating rmPAL VirtualDub's filter (Found this function in the "Favourite Scripts" thread her... thanks guys!) really works well for tha PAL alternating lines defect... removes the Green/Red lines and, WOW, restores the reds in my video wothout affecting the other colors, as far as I can see. So where's the problem? Simply, since I don't understand what this function does, I wonder if I'm losing something by using it... the result is good, and I know this is what counts, but am I doing something bad to my video? Is there any better way to achieve the same result?
Noise cleaning... I have put here Convolution3d, but just as an example... What is best in your experience, to clean some mild noise in SVHS-VHS-HI8 tape captures? Please, if possible, besides pointing me to some filters, can you also suggest their settings?
And, more on a general issue, what is better for what, talking about filters (Temporal vs. Spatial)?
Resizing is not a problem, but have a little question... since I started with a cropped size of 690x560, from an un-cropped original of 720x576, will I encounter an Aspect Ratio modification? I know it will not be much, with these values, but I need to know for the future... should I also crop in 4:3 sizes?
And, generally, what should be the sequence of the operations?
I.E. ... deinterlace before noise reduction or rmPAL? resixe at the end or before anithing else but deinterlace... this kind of info, you know...
Final question now:
My next project will be transferring all my Honeymoon/Holidays/Kids videos to SVCD, and those come from a Canon consumer HI8 camcorder... some shots are great, some others are too dark, hence noisy like hell :-(
I would like some indication on general way to treat them... things like Deinterlace or not, what filter should I use for noise and with wich settings etc...
Well, guys... I know it's whole bunch of questions in a single go, and I want to make it clear that it's not that I'm lazy and don't want to try by myself... it's just that I'm doing this in a very limited spare time and, also, lacking the technical knowledge you have on these things I may end-up testing lot of wrong/unuseful stuff and never actually doing what I want to do... get those video on digital formats! :-)
I know that part of the fun is the trial-and-error part, and I usually enjoy that too, but here we are talking BIG time spent without having good results, wich isn't fun at all...
I hope some of you will undergoo the pain to reply this long (and boring, I know...) message, and put my on straight tracks with this editing jungle...
for this, I'm really grateful to you all, and well in advance, since the little things I know on these subjects, I've learnt on this Forum!
Thank you everybody!
Looking forward to your comments/flames/insults ;-) !
Joe Daring, Italy
Here is my very first post in this Forum... so far I've spent some long hours reading your posts over here, and find them VERY informative, even if sometimes too advanced for a newbie like me...
But I guess that, in a Forum blessed with the presence of so many great developpers, it couldn't be any different than that!
So, why am I boring you with this LONG post?
It is easily said:
I am totally new to the AVISynth world, and starting to use this GREAT program (V2.5 right now) to edit some videos of mine, and to transfer them to SVCD at the moment, and to DVD-r in the future...
I've been digging the Forum for the tricks/info I need, but haven't found them, or found something that gave too much for known and, unfortunately, did not make things clear for me... not your fault, guys, but mine, since I'm a total newbie :-)
I started with tryng to put my Wedding Video on SVCD... and stumbled in some problems... let's see if I can get any help here...
WARNING!!!! Stupid/Easy Questions ahead! Steer clear if this bores you!!! ;-)
OK... the video is a 76 Minutes PAL Video shot 6 years ago with a Pro Sony camera in Beta format...
It has been edited and rendered to a SVHS tape by the Video Service that did the shooting... this is to give you a hint at the overall quality of the material Im'starting with...
I have to say that I expected an overall better quality, given it was handled by a professional service, but can't complain too much, anyway...
I have captured the video with an ATI A.I.W. Radeon 9000and VirtualDub, at 720x576 using the PicVideo MJPEG SoftCodec at maximum quality, and set the codec to capture NON-Interlaced, since after a few experiments I had the feeling that Non-Interlaced caps were a bit better than Interlaced ones, and cropped while capturing at 690x560, to cut some border noise,. Quality of the capture in nothing to sneeze at.
The capture I have on my HD now has some defects that I would like to correct...
Mainly they are:
-A strong PAL color line artifact... you know, thin red/green lines alternated on the video... also, this artifact makes the reds in my video to shift toward purples...
-Every now and again, there are glitches on the video, that are essentially thin gray lines, or couple of such lines, wich affect just one-to-three frames in a row
-There is some noise, but not much,
-Overall Audio level is low,
-Some parts of the audio has a defective Right Channel... Left is always OK.
My AVISynth script so far is this (...But, of course, not everything works :-( ):
============================================
#AVISynth script for Wedding Video Cleanup & convert to PAL SVCD res
#Output should be fed to TMpeg Plus Encoder
#Load necessary AVISynth Plugins...
#LoadPlugin("filename"[,...])
LoadPlugin("C:\Programmi\Video e Grafica\AviSynth\plugins\Convolution3dYV12.dll")
#Load eventual VirtualDub Plugins...
#LoadVirtualDubPlugin("filename","filtername", preroll)
Grafica\AviSynth\plugins\Filename.vdf","Filtername")
#Load Video File...
#AVISource(string filename[,...], bool "audio", string "pixel_type")
Avisource("E:\Temp_Folder\Video_Captures\Wedding_Video.avi")
#================#
#Audio Processing#
#================#
#Removes broken right channel for a portion of video,
#and return good left channel on a mono clip:
GoodAudio1=Trim(0,3144)
BadAudio=Trim(3145,3830).GetLeftChannel
GoodAudio2=Trim(3831,116660)
GoodAudio1+BadAudio+GoodAudio2
#Normalize audio signal to 95%:
Normalize(0.95)
#================#
#Video Processing#
#================#
#Correct levels after checking with VirtualDub's "Level" Filter.
#AVISynth "Level" filter can use the same values supplied by VirtualDub's one...
#Levels(clip, int input_low, float gamma, int input_high, int output_low, int output_high)
Levels(5,1.0,255,0,255)
#Clean-Up some video glitches in frames...
#FreezeFrame(clip, int first_frame, int last_frame, int source_frame)
FreezeFrame(41,41,40)
#More of these FreezeFrame lines...
FreezeFrame(222,224,225)
#More of these FreezeFrame lines...
FreezeFrame(18655,18655,18656)
#This Custom-Function definition should be an AVISynth
#replacement for what "rmPAL" VirtualDub's filter does
#I.E. removing PAL Phase Alternating color artifact.
function rmPAL(clip c) {
c=c.AssumeFrameBased.SeparateFields.AssumeFrameBased
MergeChroma(c,c.BlendFields(),1)
AssumeFieldBased()
return Weave()
}
#Invokes the "rmPAL" function defined above...
rmPAL
#Clean-Up some noise... Alternative noise filter...
Convolution3dYV12(0,32,128,16,64,10,0)
#Resize to PAL SVCD legal size...
#BilinearResize(clip, int target_width, int target_height)
BilinearResize(480,576)
==========================================
So... here are the problems I have with this script:
The Audio processing part for replacing broken Right Channel content with good Left Channel content does NOT work, nor seems I'm able to make it work :-(
best I can, I end-up with a video that has the Right Channel replaced by the Left one FOR THE WHOLE LENGHT of the video, not only for the part that has broken audio, making it virtually MONO... OR, I end-up with a short piece of video that is the part I defined "BadAudio", with the Right Channel correctly replaced by the Left one.
If I try to splice the three parts together, I get an error message complaining that sound formats does not match, maybe because I have a mono piece between two stereo piece....
What can I do? I know I could get the audio in a good audio tool and then audiodub it back in my video, but I would like to know if this trick is doable in AVISynth alone, and I think it is!
The low audio level problem gets cured by the Normalize command I use in my script but, is this the correct way to do it?
Level correction is very subtle, and maybe unnecessary, but it's there since I would like to create a script which would serve me as a general basis for future problems... is that OK?
The "Clean-up some glitches" part is the one stealing me A LOT of TIME. I would appreciate some suggestions... you see I'm basically covering the "Glitched" frames with the previous or following good ones... as far as I can see, there are no adverse effects on motion, since they are just single, double, or triple frames corrections. Problem is, the job is very long and tedious and, worst of all, it will not help me for other captures, since affected frames are capture-specific. Is there any kind of automatic filtering that can be done with any plugin, for this specific defect? I'm afraid the answer will be...NO! But I feel it's worth asking :-)
...and while we are at it... is it possible, with freezeframe or something else, to replace ONLY a portion of a frame (Let's say the lower third...) with the corresponding portion of another good source frame?
The custom function replicating rmPAL VirtualDub's filter (Found this function in the "Favourite Scripts" thread her... thanks guys!) really works well for tha PAL alternating lines defect... removes the Green/Red lines and, WOW, restores the reds in my video wothout affecting the other colors, as far as I can see. So where's the problem? Simply, since I don't understand what this function does, I wonder if I'm losing something by using it... the result is good, and I know this is what counts, but am I doing something bad to my video? Is there any better way to achieve the same result?
Noise cleaning... I have put here Convolution3d, but just as an example... What is best in your experience, to clean some mild noise in SVHS-VHS-HI8 tape captures? Please, if possible, besides pointing me to some filters, can you also suggest their settings?
And, more on a general issue, what is better for what, talking about filters (Temporal vs. Spatial)?
Resizing is not a problem, but have a little question... since I started with a cropped size of 690x560, from an un-cropped original of 720x576, will I encounter an Aspect Ratio modification? I know it will not be much, with these values, but I need to know for the future... should I also crop in 4:3 sizes?
And, generally, what should be the sequence of the operations?
I.E. ... deinterlace before noise reduction or rmPAL? resixe at the end or before anithing else but deinterlace... this kind of info, you know...
Final question now:
My next project will be transferring all my Honeymoon/Holidays/Kids videos to SVCD, and those come from a Canon consumer HI8 camcorder... some shots are great, some others are too dark, hence noisy like hell :-(
I would like some indication on general way to treat them... things like Deinterlace or not, what filter should I use for noise and with wich settings etc...
Well, guys... I know it's whole bunch of questions in a single go, and I want to make it clear that it's not that I'm lazy and don't want to try by myself... it's just that I'm doing this in a very limited spare time and, also, lacking the technical knowledge you have on these things I may end-up testing lot of wrong/unuseful stuff and never actually doing what I want to do... get those video on digital formats! :-)
I know that part of the fun is the trial-and-error part, and I usually enjoy that too, but here we are talking BIG time spent without having good results, wich isn't fun at all...
I hope some of you will undergoo the pain to reply this long (and boring, I know...) message, and put my on straight tracks with this editing jungle...
for this, I'm really grateful to you all, and well in advance, since the little things I know on these subjects, I've learnt on this Forum!
Thank you everybody!
Looking forward to your comments/flames/insults ;-) !
Joe Daring, Italy