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. |
10th August 2008, 13:20 | #1 | Link |
Forum Member
Join Date: May 2006
Posts: 698
|
Deinterlacing for 1920x1080i
Hi,
Could anyone recommended some scripts or link to a scripts with code examples that would work well for Deinterlacing 3D rendered graphics (PS3/Xbox360)? Over a year ago, I had several scripts for Deinterlacing and frame doubling 480i@29.97 to 480p@59.94. They worked well, but that hard-drive died an I lost them (and lots of other data, lol). Would have liked to try those scripts with this 1080i source. Anyway, here is a sample frame and video. I will try and search the forums for some examples. But any help would be appreciated as well. Thanks Frame 80 from the below five second sample video. Sample Video of 1920x1080i source from PS3. |
10th August 2008, 19:27 | #2 | Link |
Derek Prestegard IRL
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,988
|
The process you describe (480i30 to 480p60) is called bob deinterlacing. It's quite commonplace, and can be done in AviSynth as simply as Bob().
There are many other options ~MiSfit
__________________
These are all my personal statements, not those of my employer :) |
11th August 2008, 12:40 | #6 | Link |
Registered User
Join Date: Dec 2002
Location: UK
Posts: 1,673
|
This one deserves 1080p!
If mcbob is too slow for you, try... Code:
avisource("sample.avi") assumetff() converttoyuy2(matrix="PC.709") interp=last.SeparateFields().eedi2(field=-2) yadifmod(mode=1,edeint=interp) converttoRGB(matrix="PC.709") (or use different eedi2 pre-processing and yadifmod parameters) To keep the frame rate but resample to 720p, add lanczosresize(1280,720) (I prefer this option - I hate choppy movement) Cheers, David. |
11th August 2008, 20:25 | #7 | Link | |
Forum Member
Join Date: May 2006
Posts: 698
|
Quote:
Also, why does it convert to yuy2 and RGB or is that yuy2 then RBG? Here are the results with your script. 1080p@59.94 (frame 160) 1080p@59.94 (frame 160) + Anti-Aliasing Last edited by Seraphic-; 11th August 2008 at 20:34. |
|
12th August 2008, 13:19 | #8 | Link | |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
Quote:
1080i PAL delivered 0.3 fps processing speed on a Q9450 4-core when resizing to 576i. Putting ",threads=4" in every call to NNEDI inside mcbob increased the processing speed to 0.8 fps. I went back to tdeint+NNEDI+MT and get circa 18fps with a resize to 567i Last edited by halsboss; 12th August 2008 at 13:23. |
|
14th August 2008, 18:36 | #11 | Link | ||
Forum Member
Join Date: May 2006
Posts: 698
|
Quote:
I'll try and find some scripts and give your idea a try. Quote:
|
||
15th August 2008, 11:20 | #12 | Link | |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
Quote:
Code:
SetMTmode(mode=5,threads=2) # start with mode=5 forAVIsource http://forum.doom9.org/showthread.php?p=1067216#post1067216 SetMemoryMax(768) # Xfps-MT-HC-1pass 25fps settings LoadPlugin("C:\SOFTWARE\DGindex\DGDecode.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\TDeint.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\EEDI2.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\Yadifmod.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\NNEDI.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\DePan.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\AGC.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\Cnr2.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\dctfilter.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\fft3dfilter.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\degrainmedian.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\Convolution3d.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\despot.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\WarpSharp.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\aWarpSharp.dll") #LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\MaskTools.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\mvtools.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\Unfilter.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\AddgrainC.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\hqdn3d.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\mt_masktools.dll") # ------------------------------------------------------------------------------------- #LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\RemoveGrain.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\RemoveGrainSSE2.dll") #LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\Repair.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\RepairSSE2.dll") #LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\RemoveDirt.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-NOTautoloaded\RemoveDirtSSE2.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins2.0\LoadPluginEx.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins2.0\DustV5.dll") # ------------------------------------------------------------------------------------- Import("C:\Program Files\AviSynth 2.5\LimitedSharpenFaster.avsi") Import("C:\Program Files\AviSynth 2.5\dcwresize.avsi") #Import("C:\Program Files\AviSynth 2.5\DeHalo_alpha.avsi") Import("C:\Program Files\AviSynth 2.5\Deblock_QED_MT2.avs") # ------------------------------------------------------------------------------------- #--- be sure to have run DGindex over the input to yield the .d2v file ! # MPEG2Source("G:\HDTV\1\test-1080i.d2v",cpu=6) # cpu=6: DEBLOCK_Y_H, DEBLOCK_Y_V, DEBLOCK_C_H, DEBLOCK_C_V, DERING_Y, DERING_C #MPEG2Source("G:\HDTV\1\test-1080i.d2v") # cpu=6: DEBLOCK_Y_H, DEBLOCK_Y_V, DEBLOCK_C_H, DEBLOCK_C_V, DERING_Y, DERING_C AssumeFPS(25) AssumeTFF() ### THIS IS VERY IMPORTANT TO SET CORRECTLY # #--- # ------------------------------------------------------------------------------------- FRAMERATE=25 WIDTH=704 HEIGHT=576 LastW=LAST.width() LastH=LAST.height() # # ------------------------------------------------------------------------------------- #Trim(clip clip, int first_frame, int -num_frames [, bool pad_audio]) #Trim(clip clip, int first_frame, int last_frame [, bool pad_audio]) #Trim trims a video clip so that it includes only the frames first_frame through last_frame. #The audio is similarly trimmed so that it stays synchronized. #Remember AviSynth starts counting at frame 0. #pad_audio (default true) causes the audio stream to be padded to align with the video stream. #Otherwise the tail of a short audio stream is left so. #When last_frame=0 and pad_audio=false the end of the two streams remains independant. #Trim(1500, -500) #Trim(500, -750) # # ------------------------------------------------------------------------------------- # --------- DEBLOCK THE INTERLACED SOURCE IF REQUIRED - BEFORE RESIZING --------------- # ------------------------------------------------------------------------------------- # # This link shows how to DEBLOCK AN INTERLACED SOURCE #http://forum.doom9.org/showthread.php?p=1121574#post1121574 # # Deblock before resize or it doesn't deblock #SetMTmode(mode=2,threads=2) # mode=2 for temporal multi-threading (interleaved frames) #SeparateFields().PointResize(LastW,LastH).Addborders(0,0,0,8) #Deblock_QED_MT2().Cropbottom(8).AssumeFrameBased() #default quant1=20 #Deblock_QED_MT2(quant1=25).Cropbottom(8).AssumeFrameBased() #Deblock_QED_MT2(quant1=30).Cropbottom(8).AssumeFrameBased() #Deblock_QED_MT2(quant1=35).Cropbottom(8).AssumeFrameBased() #Deblock_QED_MT2(quant1=40).Cropbottom(8).AssumeFrameBased() #SeparateFields().SelectEvery(4,0,3).Weave() # # ------------------------------------------------------------------------------------- # ------------------------------------------------------------------------------------- # --------- RESIZE THE INTERLACE CLIP ------------------------------------------------- # ------------------------------------------------------------------------------------- # # This link shows how to resize interlaced #http://forum.doom9.org/showthread.php?p=1115201#post1115201 # # ------------------------------------------------------------------------------------- SetMTmode(mode=2,threads=2) # mode=2 for temporal multi-threading (interleaved frames) bicubicresize(704,LAST.height()) tdeint(mode=1,order=1) # mode=0=same rate output mode=1=double rate output (bobbing) order=0=BFF order=1=TFF bicubicresize(last.width(),576) separatefields() selectevery(4,0,3) weave() # ------------------------------------------------------------------------------------- #SetMTmode(mode=2,threads=2) # mode=2 for temporal multi-threading (interleaved frames) #bicubicresize(704,LAST.height()) # see http://forum.doom9.org/showthread.php?p=1114448#post1114448 # tcritical plugins http://bengal.missouri.edu/~kes25c/ # for yadifmod tff Order=1 ; for nnedi field=-2 means assumeTFF is important #yadifmod(mode=1, order=1, edeint=nnedi(field=-2)) #bob deinterlace it without stairstepping to 50 #bicubicresize(last.width(),576) #separatefields() #selectevery(4,0,3) #weave() # ------------------------------------------------------------------------------------- # Converttoyv12(interlaced=true) # SetPlanarLegacyAlignment(True) # Distributor() should only be used when loading the script into applications which talk to avisynth directly # e.g. HC and MeGUI. If the program opens the .avs file as an avi file (like virtualdub/mod, x264, xvid_encraw etc.) # then you don't need (and shouldn't have) the distributor call at the end. # http://forum.doom9.org/showthread.php?p=1136518#post1136518 ##### "HC uses custom avisynth routines, you have to add Distributor() to the end of the script." Distributor() # use this when using HC and SetMTmode, per http://forum.doom9.org/showthread.php?p=1063622#post1063622 # http://forum.doom9.org/showthread.php?p=1067589#post1067589 # ChangeFPS(Last, Last, True) makes fast scripts faster and slow scripts slower !! #ChangeFPS(Last, Last, True) # use this when using HC and SetMTmode, per http://forum.doom9.org/showthread.php?p=1064118#post1064118 Code:
*INFILE G:\HDTV\1\test-1080i-CQ2.5.avs *OUTFILE G:\HDTV\1\test-1080i.mpv *INTERLACED *TFF *LOGFILE G:\HDTV\1\test-1080i-HC-CQ2.5.log *PROFILE BEST *ASPECT 16:9 *BIAS 50 *BITRATE 9350 *MAXBITRATE 9450 *LASTIFRAME *AUTOGOP 15 *PULLDOWN *CLOSEDGOPS *DBPATH G:\HDTV\1\ *LLPATH G:\HDTV\1\ *DC_PREC 10 *CQ_MAXBITRATE 2.5 *MATRIX MPEG Last edited by halsboss; 15th August 2008 at 11:31. |
|
15th August 2008, 11:30 | #13 | Link |
Registered User
Join Date: Mar 2004
Posts: 889
|
Oh, I thought you were using nnedi() inside MT(). I had never managed to do it right coz it's always complaining the height not being mod 4 (or 2 ... dun remember).
Last edited by henryho_hk; 15th August 2008 at 12:56. |
15th August 2008, 12:20 | #14 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
Oh, I'll give it a try on a sample ...
have you seen http://forum.doom9.org/showthread.ph...24#post1161524 which does away with deinterlacing ? I wonder how that compares to the tdeint thingo. I don't know how to do the "differences" thing... On the other hand I'm not surprised if you mean using MT rather than setmtmode on the basis MT chops up the input frames and farms it out. iirc the MT thread has a suggestion/request for addressing that which never got a bite from anyone. Which do you mean ? Last edited by halsboss; 15th August 2008 at 12:32. |
15th August 2008, 13:09 | #15 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
On a Q9450 4-core with EP45 motherboard and 4Gb Ram XP-sp3
Code:
SetMTmode(mode=2,threads=2) # mode=2 for temporal multi-threading (interleaved frames) bicubicresize(704,LAST.height()) tdeint(mode=1,order=1) # mode=0=same rate output mode=1=double rate output (bobbing) order=0=BFF order=1=TFF bicubicresize(last.width(),576) separatefields() selectevery(4,0,3) weave() Code:
pass 1 encoding time: 0:01:37 (96.64 s) fps: 18.3 nr. of gops: 134 nr. of frames: 1765 nr. of I-frames: 134 nr. of P-frames: 612 nr. of B-frames: 1019 average bitrate: 5627 minimum bitrate: 2248 maximum bitrate: 9447 bytes in bitstream: 49673678 bits in bitstream: 397389424 average Quantizer: 2.901 total CPU time: 0:03:19 (96.64 s) total elapsed time: 0:01:37 (97.36 s) Code:
SetMTmode(mode=2,threads=2) # mode=2 for temporal multi-threading (interleaved frames) bicubicresize(704,LAST.height()) tdeint(mode=1,order=1,edeint=nnedi(field=-2,threads=4)) # mode=0=same rate output mode=1=double rate output (bobbing) order=0=BFF order=1=TFF bicubicresize(last.width(),576) separatefields() selectevery(4,0,3) weave() Code:
pass 1 encoding time: 0:04:07 (247.20 s) fps: 7.1 nr. of gops: 134 nr. of frames: 1765 nr. of I-frames: 134 nr. of P-frames: 612 nr. of B-frames: 1019 average bitrate: 5640 minimum bitrate: 2269 maximum bitrate: 9400 bytes in bitstream: 49782993 bits in bitstream: 398263944 average Quantizer: 2.911 total CPU time: 0:13:32 (247.20 s) total elapsed time: 0:04:07 (247.48 s) Code:
Global NewHeight=576 Global NewWidth=704 SeparateFields() Shift=(Height()/Float(NewHeight/2)-1.0)*0.25 Tf=SelectEven().LanczosResize(NewWidth, NewHeight/2, 0, -Shift, Width(), Height()) Bf=SelectOdd().LanczosResize(NewWidth, NewHeight/2, 0, Shift, Width(), Height()) Interleave(Tf, Bf) Weave() Code:
pass 1 encoding time: 0:01:49 (109.31 s) fps: 16.1 nr. of gops: 134 nr. of frames: 1765 nr. of I-frames: 134 nr. of P-frames: 612 nr. of B-frames: 1019 average bitrate: 6077 minimum bitrate: 2287 maximum bitrate: 9442 bytes in bitstream: 53639890 bits in bitstream: 429119120 average Quantizer: 2.988 total CPU time: 0:02:20 (109.31 s) total elapsed time: 0:01:50 (109.53 s) Last edited by halsboss; 15th August 2008 at 14:01. |
15th August 2008, 13:34 | #16 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
With a different test clip - fast action sports footage in the last half of this 2nd test clip,
TDEINT alone yielded Code:
pass 1 encoding time: 0:02:09 (128.73 s) fps: 16.6 nr. of gops: 144 nr. of frames: 2134 nr. of I-frames: 144 nr. of P-frames: 796 nr. of B-frames: 1194 average bitrate: 8691 minimum bitrate: 5260 maximum bitrate: 9446 bytes in bitstream: 92743030 bits in bitstream: 741944240 average Quantizer: 3.656 total CPU time: 0:04:43 (128.73 s) total elapsed time: 0:02:09 (129.01 s) Code:
pass 1 encoding time: 0:05:58 (358.05 s) fps: 6.0 nr. of gops: 144 nr. of frames: 2134 nr. of I-frames: 144 nr. of P-frames: 798 nr. of B-frames: 1192 average bitrate: 8690 minimum bitrate: 5279 maximum bitrate: 9447 bytes in bitstream: 92737303 bits in bitstream: 741898424 average Quantizer: 3.687 total CPU time: 0:19:49 (358.05 s) total elapsed time: 0:05:58 (358.31 s) Code:
pass 1 encoding time: 0:02:17 (136.92 s) fps: 15.6 nr. of gops: 144 nr. of frames: 2134 nr. of I-frames: 144 nr. of P-frames: 806 nr. of B-frames: 1184 average bitrate: 8625 minimum bitrate: 6469 maximum bitrate: 9447 bytes in bitstream: 92040795 bits in bitstream: 736326360 average Quantizer: 4.047 total CPU time: 0:03:11 (136.92 s) total elapsed time: 0:02:17 (137.14 s) Last edited by halsboss; 15th August 2008 at 14:40. |
15th August 2008, 13:54 | #17 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
Just for fun, with the same 2nd "action" source, changed the first 2 from bicubicresize to LanczosResize so
threads=2 TDEINT yielded Code:
pass 1 encoding time: 0:02:15 (134.51 s) fps: 15.9 nr. of gops: 144 nr. of frames: 2134 nr. of I-frames: 144 nr. of P-frames: 802 nr. of B-frames: 1188 average bitrate: 8628 minimum bitrate: 5608 maximum bitrate: 9408 bytes in bitstream: 92078060 bits in bitstream: 736624480 average Quantizer: 3.999 total CPU time: 0:04:56 (134.51 s) total elapsed time: 0:02:15 (134.83 s) Code:
pass 1 encoding time: 0:06:07 (366.84 s) fps: 5.8 nr. of gops: 144 nr. of frames: 2134 nr. of I-frames: 144 nr. of P-frames: 802 nr. of B-frames: 1188 average bitrate: 8625 minimum bitrate: 5619 maximum bitrate: 9442 bytes in bitstream: 92040840 bits in bitstream: 736326720 average Quantizer: 4.036 total CPU time: 0:20:24 (366.84 s) total elapsed time: 0:06:07 (367.14 s) Last edited by halsboss; 15th August 2008 at 14:27. |
15th August 2008, 14:04 | #18 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
For the 2nd sports clip, now I remembered to put in the SetMTmode(mode=2,threads=2) # mode=2 for temporal multi-threading (interleaved frames)
Code:
SetMTmode(mode=2,threads=2) # mode=2 for temporal multi-threading (interleaved frames) Global NewHeight=576 Global NewWidth=704 SeparateFields() Shift=(Height()/Float(NewHeight/2)-1.0)*0.25 Tf=SelectEven().LanczosResize(NewWidth, NewHeight/2, 0, -Shift, Width(), Height()) Bf=SelectOdd().LanczosResize(NewWidth, NewHeight/2, 0, Shift, Width(), Height()) Interleave(Tf, Bf) Weave() Code:
pass 1 encoding time: 0:01:46 (106.01 s) fps: 20.1 nr. of gops: 144 nr. of frames: 2134 nr. of I-frames: 144 nr. of P-frames: 806 nr. of B-frames: 1184 average bitrate: 8625 minimum bitrate: 6469 maximum bitrate: 9447 bytes in bitstream: 92040795 bits in bitstream: 736326360 average Quantizer: 4.047 total CPU time: 0:03:09 (106.01 s) total elapsed time: 0:01:46 (106.23 s) |
15th August 2008, 14:25 | #19 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
Oh why not ... Last and final, 2nd "sports clip" with all lanczos and this time all "SetMTmode(mode=2,threads=4)" instead of "SetMTmode(mode=2,threads=2)"
1. TDEINT Code:
pass 1 encoding time: 0:01:53 (112.92 s) fps: 18.9 nr. of gops: 144 nr. of frames: 2134 nr. of I-frames: 144 nr. of P-frames: 802 nr. of B-frames: 1188 average bitrate: 8628 minimum bitrate: 5608 maximum bitrate: 9408 bytes in bitstream: 92078060 bits in bitstream: 736624480 average Quantizer: 3.999 total CPU time: 0:05:05 (112.92 s) total elapsed time: 0:01:53 (113.25 s) Code:
pass 1 encoding time: 0:05:21 (321.39 s) fps: 6.6 nr. of gops: 144 nr. of frames: 2134 nr. of I-frames: 144 nr. of P-frames: 802 nr. of B-frames: 1188 average bitrate: 8625 minimum bitrate: 5619 maximum bitrate: 9442 bytes in bitstream: 92040840 bits in bitstream: 736326720 average Quantizer: 4.036 total CPU time: 0:20:43 (321.39 s) total elapsed time: 0:05:22 (321.70 s) Code:
pass 1 encoding time: 0:01:51 (111.20 s) fps: 19.2 nr. of gops: 144 nr. of frames: 2134 nr. of I-frames: 144 nr. of P-frames: 806 nr. of B-frames: 1184 average bitrate: 8625 minimum bitrate: 6469 maximum bitrate: 9447 bytes in bitstream: 92040795 bits in bitstream: 736326360 average Quantizer: 4.047 total CPU time: 0:03:23 (111.20 s) total elapsed time: 0:01:51 (111.45 s) Last edited by halsboss; 15th August 2008 at 14:37. Reason: checked and re-ran the last one again 19.7 fps, nothing else running. |
15th August 2008, 16:16 | #20 | Link |
Registered User
Join Date: Jan 2006
Posts: 141
|
@seraphic
I use the following generic script with dgindex to invert telecine all ntsc and atsc captures streams and output a video that is 23.976 fps. Code:
#SetMemoryMax(512) loadplugin("c:\program files\media\avisynth\plugins\tivtc.dll") dgdecode_mpeg2source("__vid__",info=3) hsize = string(height()) eval("f" + hsize + "()") tdecimate(mode=1,hybrid=1,hint=true,concycle=1,nt=2,vidDetect=2,dupthresh=5,vidthresh=5) # Notes # ----- # Uncomment any of the following functions as needed # Obviously do not use both rsize function at once # Adjust the letterbox sizes as needed # Do not use the letterbox function with the zoom function # Instead make the necessary letterbox changes in the scripclip line #greyscale() #rsize16x9() #rsize4x3() #lbox() #zoom() #info() # End of Main Script # rsize16x9: Function for Resizing to 16x9 SD video # -------------------------------------------------- function rsize16x9(v) { wide = (704 == v.width()) ? 704 : 720 high = Select(ndx,360,720,1080) start = Select(ndx,60,0,0) v.lanczos4Resize(wide,480,0,start,v.width(),high) 720 == width() ? crop(8,0,704,480) : NOP return last } # rsize4x3: Function for Resizing to 4x3 SD video # ------------------------------------------------ function rsize4x3(v) { wide = (704 == v.width()) ? 704 : 720 v.lanczos4Resize(wide,360,0,60,v.width(),v.height()) addBorders(0,60,0,60) 720 == width() ? crop(8,0,704,480) : NOP return last } # lbox: Function for adding Letterboxes to video # ----------------------------------------------- # Note the values after ndx are for 480p, 720p and 1080p respectively function lbox(v) { top = Select(ndx,60,0,0) bottom = Select(ndx,60,0,0) left = Select(ndx,0,160,240) right = Select(ndx,0,160,240) return v.letterbox(top,bottom,left,right) } # zoom: Function for removing Zoomed video sections # -------------------------------------------------- # Set frame1 to the first moving frame in the zoomed or animated sequence # Set frame2 to the first non-moving frame after the zoomed or animated sequence # Set x1,y1 and x2,y2 to the crop values obtained from virtualDub. # Note x1, y1, x2, y2 must be even numbers # Note frame numbers should be at tdecimated 23.976 fps rate to avoid interlaced lines function zoom(v) { last = v x1 = 8 y1 = 94 x2 = 272 y2 = 92 x = width()-x1-x2 y = height()-y1-y2 frame1 = 313 frame2 = 322 animate(frame1,frame2,"lanczos4resize", \ width(),height(),x1,y1,x,y, \ width(),height(),0,0,width(),height()) scriptclip("current_frame <= " + string(frame2) +" ? letterbox(2,2,8,8) : letterbox(2,2,8,8)") return last } # f480: Function for 704 or 720 x 480i video # ------------------------------------------- function f480(v) { global ndx = 0 720 == v.width() ? v.crop(8,2,704,476) : v.crop(0,2,704,476) addBorders(0,2,0,2) return tfm(mode=4) } # f720: Function for 1280 x 720p video # ------------------------------------- function f720(v) { global ndx = 1 v.crop(2,8,1276,704) addborders(2,8,2,8) return selecteven() } # f1080: Function for 1920 x 1080i video # --------------------------------------- function f1080(v) { global ndx = 2 v.crop(2,8,1916,1064) addborders(2,8,2,8) return tfm(mode=4) } |
Thread Tools | Search this Thread |
Display Modes | |
|
|