View Full Version : Convert DV video for using in Webpages
bairradino
9th November 2007, 16:20
I have some videos made in a DV camcoder that I want to publish in my webpage.
The original footage is PAL 720x576 (of course) with PAR 16:9.
I intend to obtain a XVid progressive video, size 320x240, 25 fps, with same PAR.
Can you, please, comment if the following script is adequate in order to obtain the best quality?
LoadPlugin("C:\Program Files\Avisynth 2.5\Plugins\TDeint.dll")
AviSource("C:\temp\x.avi")
ConvertToYuY2(interlaced=true)
Crop(8,0,-8,0)
TDeint(mode=0,order=0)
LanczosResize(320,180)
AddBorders(0,30,0,30)
Adub
10th November 2007, 09:28
In terms of quality, the setting you use on your xvid encode are more important than most of your avisynth options.
Deinterlacing will obviously have an affect on quality, but if you do it right, then your golden.
smok3
10th November 2007, 10:37
why addborders?
themostestultimategenius
10th November 2007, 14:00
^ Because his video is 16:9 and he needs the video to be a 320x240 one =p
bairradino
14th November 2007, 19:13
Is there a better way of getting progressive video?
Witch are the best settings of XviD for getting a small file with minimum of quality?
smok3
14th November 2007, 19:35
i would either use x.264/neroAAC.mp4 with qt compliant settings ("best quality for web") or flash video (vp6+mp3.flv - "best penetration"), you can also use xvid for mp4, but i dont see why would you want that.
p.s. Ok, i didn't say best..., twice, it just appears that way.
scharfis_brain
14th November 2007, 19:39
I'd suggest to use 320x176 pixels (not 180!):
avisource("blah.avi")
bicubicresize(320,height)
yadif()
bicubicresize(width,176)
(with 320x176 you don't need to crop 8 pixels each side,
cause 320x176 is a bit more wide than actual 16x9 so it is quite close to full D1 16x9)
Also I second smok3: there is no need to add borders at top and bottom.
just encode at 320x176. it is mod16 so you won't have any problem with XViD.
you also might want to add a denoiser to your script (place it after yadif()) to lower the need of bitrate of XViD.
another option is to lower the framerate to 16.666 fps:
replace yadif() with yadif(mode=1).selectevery(3,1)
or to 12.5 fps:
replace yadif() with yadif().selecteven()
SeeMoreDigital
14th November 2007, 20:19
Personally speaking instead of encoding at a resolution of 320x240 pixels, I'd use a resolution of 512x288 pixels or 360x288 pixels with 65:45 aspect ratio signalling. And most definitely MPEG-4 AVC video with AAC audio ;)
bairradino
15th November 2007, 13:14
Thanks for your help.
I encode with XviD because it's supported by all video players and the purpose, as I said, is to get videos for webpages.
As much as I know the WMPlayer (common installation), for example, doesn't read H.264 encoded files.
Regarding black bars I think you are right. I was afraid tha the players, usually definer for 4:3, could strech the video, but I made a test with YouTube and it works.
About de denoiser... what do you suggest for DV source? Convolution3D?
I'm using a 8 pixel crop each horizontal side not for Encoding but because the D1 Pal only uses 704 pixel of video.
Blue_MiSfit
15th November 2007, 19:26
Well think about it like this
Flash has the highest penetration. It's practically guaranteed that if you make a Flash compliant video, anyone will be able to watch it. QuickTime is also up there, and gives you the advantage of being able to deliver H.264 and AAC, which has the potential to look much better (at the same data rate) than Flash. It's also much more CPU intensive. IMO, due to QuickTime's horribly inefficient decoder.
Now - things have / may change recently. Flash supports H.264 video and AAC audio, but I'm not sure if it's part of the official player yet. I know it exists in beta editions, but it might not be official.
As far as denoisers go, there are lots of options. fft3dfilter/fft3dgpu, mvdegrain, removegrain, frfun, fluxsmooth etc... convolution3d is pretty much deprecated at this point IMO, but it's a place to start.
~MiSfit
bairradino
20th November 2007, 16:09
It is clear that I want to convert some DV PAL videos (interlaced) to progressive of a certain size (320x240, for instance).
I read several posts regarding this process, and I must admit that I'm a little bit confused.
It seems to me that the sequence must be:
1. Loading plugins
2. Open video
3. Deinterlace
4. Resize
5. Denoise (eventually)
Am I correct?
I so, the script should be, for example,
LoadPlugin("C:\Programas\Avisynth 2.5\Plugins\TDeint.dll")
LoadPlugin("C:\Programas\Avisynth 2.5\Plugins\EEDI2_imp.dll")
LoadPlugin("C:\Programas\Avisynth 2.5\Plugins\fft3dfilter.dll")
AviSource("C:\temp\x.avi")
ConvertToYuY2(interlaced=true)
interp = separatefields().selecteven().EEDI2(field=0)
tdeint(order=0,field=0,edeint=interp)
BicubicResize(320,240)
fft3dfilter(sigma=1.5,bt=5,bw=32,bh=32,ow=16,oh=16,sharpen=0.4,interlaced=false)
As my source video is 720x576 widescreen I must configure the encoder to give a 16:9 PAR output.
I'd like to have your valuable comments regarding the sequence and plugins.
Adub
20th November 2007, 22:00
Why the conversion to YUY2? Normally you want to stick with YV12.
smok3
21st November 2007, 15:55
for such a small resolution, this should probably do (and it will be mucho faster):
a=avisource("somefile.avi")
a=a.converttoyv12()
# drop even fields and resize:
a=a.SeparateFields.SelectOdd.LanczosResize(320,240)
return(a)
iam not sure if it is wise to run denoiser on such small image, i would put it before resizer (but thats subjective and also has a lot to do with the actual source)
bairradino
22nd November 2007, 21:37
@smok3
I think that when we want to make a small image (down resizing) it's better to denoise after resizing because the encoding is much faster.
In terms of quality is there any difference when denoising in original format before down resizing?
smok3
23rd November 2007, 09:40
sure, on smaller image there is less to analyze and bigger chance that things that aren't noise gets removed.
probably i would do it in this order:
1. denoise
2. resize
3. slight sharpening (if needed at all)
or
1. denoise
2. resize
3. slight denoise
4. slight sharpening (if needed at all)
p.s. for speed: there is gpu-ed version of fft3d
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.