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 |
Registered User
Join Date: Nov 2007
Posts: 114
|
First time using avisynth, need advice
I have about 24 min of DV PAL (interlaced, BFF) footage that I want to convert to xvid. For a target size, I would be happy with about 200 mb.
Ok, so first I believe I want to deinterlace, because I want to end up with progressive 25 fps. What is a good deinterlacer for this purpose? IMO, this footage shouldn't be too hard to deinterlace since the camera remains static all the time and movement is fairly limited. I may also want to do some mild denoising, as DV is quite noisy, especially in dark areas and I think denoising makes compression easier. What denoising filters do you recommend? As for aspect ratio, the resolution is standard PAL (720x576) and DAR is 16/9. I guess the best solution for this is to resize to 720x405? This is how my script looks thus far: Code:
Load_Stdcall_plugin("yadif.dll") AVISource("C:\Casbah.avi") Yadif(clip, int "0", int "0") FastBicubicResize(720,405) ![]() Oh, and here's a sample. |
![]() |
![]() |
![]() |
#4 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Yadif is a reasonable smart bob. The correct syntax is Yadif(0, 0)
I would choose a sharper resizer like the internal Spline36Resize(). FastBicubicResize() is a fairly old external plugin and the internal resizers are very fast. For Xvid the height needs to be an even number and preferable a number divisible by 16. Popular 16:9 mod16 Xvid sizes with the aspect error. 512x288 0% 544xx304 1.2% 576x320 2.2% 592x336 -1.6% 624x352 -0.5% 656x368 0.5% 688x384 1.4% 704x400 -1.8% For decoding DV I would recommend Cedocida. Seeing you have an interlaced source working in "YUY2" may avoid any chroma problems. AVISource("C:\Casbah.avi", pixel_type="YUY2"). 24 Minutes and 200mb would be 1000kbits video and 128kbits audio, this is generous and extra denoising may not be necessary. Last edited by IanB; 5th January 2009 at 03:36. Reason: Opps wrong syntax :( |
![]() |
![]() |
![]() |
#6 | Link | |
Registered User
Join Date: Nov 2007
Posts: 114
|
Thanks for your help thus far!
![]() My script now looks like this: Code:
Load_Stdcall_plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll") AVISource("Casbah.avi") Yadif(0, 0) Spline36Resize(656, 368) ![]() Quote:
![]() Another thing, what YV12 option should I check Cedocida's options? My guess would be DV? Also, I hope it's ok if I additionally ask for advice with xvid encoder settings. Bitrate will be quite high, about 1200 kbps, so for matrix I guess MPEG is fine, I haven't looked into any custom matrices... Additional settings (unrestricted):
Any settings anybody thinks I should change? I'm going to put keyframes to every tenth frame since there is no scene change in this footage, the camera remains static all the way. ![]() Last edited by kutjong; 6th January 2009 at 00:56. |
|
![]() |
![]() |
![]() |
#7 | Link | |
Sleepy overworked fellow
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
|
Quote:
__________________
AnimeIVTC() - v2.00 -http://boinc.berkeley.edu/- Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p) |
|
![]() |
![]() |
![]() |
#8 | Link | |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Quote:
Cedocida does a fully correct job converting DV chroma to YUY2. I wanted to make it easy for you and just make the issues go away, hence YUY2. IIRC the panasonic DV decoder outputs RGB24 and it does a poxy job on aligning the chroma and has luma range issues. Yadif only does YUY2 and YV12. With YUY2 from Cedocida, there are no level issues, what is on your tape ends up in YUY2, i.e. you get to choose how to control the levels if anything needs to be done. With YUY2 there are no chroma placement issues, YUY2 has no vertical subsampling. As Xvid is a 4:2:0 format and matches Avisynth's default YV12, you can convert to YV12 after all the interlaced issues have been eliminated. Code:
Load_Stdcall_plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll") AVISource("Casbah.avi", Pixel_type="YUY2") # Using Cedocida for DV Yadif(0, 0) # Deinterlace ConvertToYV12() Spline36Resize(656, 368) |
|
![]() |
![]() |
![]() |
#9 | Link |
Derek Prestegard IRL
![]() Join Date: Nov 2003
Location: Los Angeles
Posts: 5,977
|
All excellent advice, so far!
As far as the denoising goes, I'd suggest fft3dfilter, or fft3dgpu if you have a fast graphics card. DV usually has very noisy chroma, so I'd clean that right off the bat (after deinterlacing). So, taking the existing script and modifying it a bit: Code:
Load_Stdcall_plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll") AVISource("Casbah.avi", Pixel_type="YUY2") # Using Cedocida for DV Yadif(0, 0) # Deinterlace ConvertToYV12() fft3dfilter(plane=3, sigma=2) #clean the chroma planes, tweak sigma as necessary fft3dfilter(plane=0, sigma=1, sigma2=2, sigma3=2, sigma4=1) #clean the luma plane, tweak the sigmas as necessary gradfunkmirror(1.51) #Dither the banding that fft3dfilter might reveal Spline36Resize(1024, 576) #why not expand horizontally to 1:1, or leave at 720x576 and set 16x9 when muxing? Just some thoughts ![]() ~MiSfit
__________________
These are all my personal statements, not those of my employer :) Last edited by Blue_MiSfit; 7th January 2009 at 10:04. |
![]() |
![]() |
![]() |
#11 | Link |
Sleepy overworked fellow
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
|
3rd link of "gradfunkmirror" on google:http://forum.doom9.org/showthread.ph...15#post1111315
you'll also need gradfun2db http://kosmos.kawaii-shoujo.net/gradfun2db/
__________________
AnimeIVTC() - v2.00 -http://boinc.berkeley.edu/- Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p) |
![]() |
![]() |
![]() |
#13 | Link |
Sleepy overworked fellow
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
|
oh, when you have script functions like this, save them as functionname.avsi in your plugins directory and they'll be autoloaded just like dlls.
__________________
AnimeIVTC() - v2.00 -http://boinc.berkeley.edu/- Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p) |
![]() |
![]() |
![]() |
#14 | Link |
Derek Prestegard IRL
![]() Join Date: Nov 2003
Location: Los Angeles
Posts: 5,977
|
Yeah, gradfunkmirror is just a little wrapper for gradfun2db that fixes its curious behavior of not dithering the edges of images.
__________________
These are all my personal statements, not those of my employer :) |
![]() |
![]() |
![]() |
#15 | Link |
Registered User
Join Date: Nov 2007
Posts: 114
|
Ok, thanks.
![]() BTW, when examining the original DV avi file with gspot, it tells me that there is "1.35 GB unneeded bytes at end of file". Is there an easy way to get rid of these unneeded bytes? |
![]() |
![]() |
![]() |
Tags |
aspect ratio, deinterlacing, denoise, pal |
Thread Tools | Search this Thread |
Display Modes | |
|
|