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.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th August 2012, 07:27   #1  |  Link
gurusinghbrar
Registered User
 
Join Date: Jul 2012
Posts: 39
Any tool for Autocrop and Resize based on ffmpeg

hi all..

anyone know about any tool which autocrop and resize the input video and show only the output values for use in ffmpeg base encoding,,or tool like megui resize or crop tool wich run separately not included in megui.

or any one have any batch file which detect video like avi,mkv,mp4 file and load into .avs file and use autocrop and autoresize filter/method on it and save the out values(crop and resuze value only) in text file...

thanx..
gurusinghbrar is offline   Reply With Quote
Old 30th August 2012, 15:26   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,996
Maybe of interest: QueryborderCrop(), Requires RT_Stats v1.03 plug & GScript for Avisynth.
http://forum.doom9.org/showthread.ph...57#post1586857

And examples using it:

http://forum.doom9.org/showthread.ph...60#post1586860
http://forum.doom9.org/showthread.ph...22#post1589022

EDIT: Or this modified script:

Code:
GSCript("""

RELATIVE=   true            # True show width as eg -8, False as eg 640
DEBUG   =   True            # Show output in DebugView
OUTFILE =   "CROP.TXT"      # Crop log

VideoFileName   =LCase("D:\TEST_VOBS\PAL-P_169_P\ReturnOfTheKing_Extended.d2v")
MPEG2Source(VideoFileName,cpu2="xxxxxx")

QBC=QueryBorderCrop(Relative=RELATIVE,Debug=DEBUG)          # Get Return string and initialize QBCropX type variables in Avisynth

Eval(QBC)   # Set crop variables
#Spline36Resize(640,480,QBCropX,QBCropY,QBCropW,QBCropH)    # Crop Exact, DO NOT USE IN CROP, OK in Resize
#Crop(QBCropXL,QBCropYL,QBCropWL,QBCropHL)                  # CropLess
Crop(QBCropXM,QBCropYM,QBCropWM,QBCropHM)                   # CropMore
#Crop(QBCropXP,QBCropYP,QBCropWP,QBCropHP)                  # CropPlus

A = RT_TxtGetLine(QBC,0)                                    # Exact
B = RT_TxtGetLine(QBC,1)                                    # CropLess
C = RT_TxtGetLine(QBC,2)                                    # CropMore
D = RT_TxtGetLine(QBC,3)                                    # CropPlus
Subtitle(A,y=0)
Subtitle(B,y=20)
Subtitle(C,y=40)
Subtitle(D,y=60)

RT_TxtWriteFile(QBC,OUTFILE)                                # write log file

return last
""")
With results in Debugview:
Code:
00000004  15:35:38  RT_Debug: QBC:  
00000005  15:35:38  RT_Debug: QBC: QueryBorderCrop v1.08 - 29 Aug 2012 - By StainlessS  
00000006  15:35:38  RT_Debug: QBC:  
00000007  15:35:38  RT_Debug: QBC: Samples=24 Thresh=-32.00 Laced=true Matrix=2 
00000008  15:35:38  RT_Debug: QBC: XMod=2 YMod=4 WMod=4 HMod=4  
00000009  15:35:38  RT_Debug: QBC: Relative=true Prefix=QBCrop RLBT=15 Ignore=0.20  
00000010  15:35:38  RT_Debug: QBC:  
00000011  15:35:38  RT_Debug: QBC: AutoThresh Using Avisynth Planar Luma Sampling 
00000012  15:35:39  RT_Debug: QBC: AutoThresh 1 ) [715  ] YPlaneMin=16  
00000013  15:35:39  RT_Debug: QBC: AutoThresh 2 ) [1430 ] YPlaneMin=16  
00000014  15:35:39  RT_Debug: QBC: AutoThresh 3 ) [2145 ] YPlaneMin=16  
00000015  15:35:39  RT_Debug: QBC: AutoThresh 4 ) [2860 ] YPlaneMin=16  
00000016  15:35:40  RT_Debug: QBC: AutoThresh 5 ) [3575 ] YPlaneMin=16  
00000017  15:35:40  RT_Debug: QBC: AutoThresh 6 ) [4290 ] YPlaneMin=16  
00000018  15:35:40  RT_Debug: QBC: AutoThresh 7 ) [5004 ] YPlaneMin=16  
00000019  15:35:40  RT_Debug: QBC: AutoThresh 8 ) [5719 ] YPlaneMin=16  
00000020  15:35:41  RT_Debug: QBC: AutoThresh 9 ) [6434 ] YPlaneMin=16  
00000021  15:35:41  RT_Debug: QBC: AutoThresh 10) [7149 ] YPlaneMin=16  
00000022  15:35:41  RT_Debug: QBC: AutoThresh 11) [7864 ] YPlaneMin=16  
00000023  15:35:41  RT_Debug: QBC: AutoThresh 12) [8579 ] YPlaneMin=16  
00000024  15:35:42  RT_Debug: QBC: AutoThresh 13) [9294 ] YPlaneMin=16  
00000025  15:35:42  RT_Debug: QBC: AutoThresh 14) [10009] YPlaneMin=16  
00000026  15:35:42  RT_Debug: QBC: AutoThresh 15) [10724] YPlaneMin=16  
00000027  15:35:42  RT_Debug: QBC: AutoThresh 16) [11439] YPlaneMin=16  
00000028  15:35:42  RT_Debug: QBC: AutoThresh 17) [12154] YPlaneMin=16  
00000029  15:35:43  RT_Debug: QBC: AutoThresh 18) [12869] YPlaneMin=16  
00000030  15:35:43  RT_Debug: QBC: AutoThresh 19) [13583] YPlaneMin=16  
00000031  15:35:43  RT_Debug: QBC: AutoThresh 20) [14298] YPlaneMin=16  
00000032  15:35:43  RT_Debug: QBC: AutoThresh 21) [15013] YPlaneMin=16  
00000033  15:35:44  RT_Debug: QBC: AutoThresh 22) [15728] YPlaneMin=16  
00000034  15:35:44  RT_Debug: QBC: AutoThresh 23) [16443] YPlaneMin=16  
00000035  15:35:44  RT_Debug: QBC: AutoThresh 24) [17158] YPlaneMin=16  
00000036  15:35:44  RT_Debug: QBC: AutoThresh Thresh=48.00  
00000037  15:35:44  RT_Debug: QBC:  
00000038  15:35:48  RT_Debug: QBC: Top 2) [1430 ] AveY=65.15 CY=75  
00000039  15:35:48  RT_Debug: QBC: Bot 2) [1430 ] AveY=61.18 CH=-76 
00000040  15:35:48  RT_Debug: QBC: Lft 2) [1430 ] AveY=48.26 CX=46  
00000041  15:35:49  RT_Debug: QBC: Rgt 2) [1430 ] AveY=48.14 CW=-77 
00000042  15:35:49  RT_Debug: QBC: Lft 3) [2145 ] AveY=120.76 CX=0  
00000043  15:35:49  RT_Debug: QBC: Rgt 3) [2145 ] AveY=106.21 CW=0  
00000044  15:36:02  RT_Debug: QBC: Active Frames (where image coords first found) = 2 
00000045  15:36:02  RT_Debug: QBC: Sampled Borders: X=0 Y=75 W=0(720) H=-76(425)  
00000046  15:36:02  RT_Debug: QBC:  
00000047  15:36:02  RT_Debug: QBC: CropExact: X = 0 Y =75 W =720(0) H =425(-76) 
00000048  15:36:02  RT_Debug: QBC: CropLess:  XL= 0 YL=72 WL=720(0) HL=428(-76) 
00000049  15:36:02  RT_Debug: QBC: CropMore:  XM= 0 YM=76 WM=720(0) HM=424(-76) 
00000050  15:36:02  RT_Debug: QBC: CropPlus:  XP= 2 YP=80 WP=716(-2) HP=416(-80)  
00000051  15:36:02  RT_Debug: QBC:  
00000052  15:36:02  RT_Debug: QBC: Return: QBCropX=0 QBCropY=75 QBCropW=0 QBCropH=-76 
00000053  15:36:02  RT_Debug: QBC: Return: QBCropXL=0 QBCropYL=72 QBCropWL=0 QBCropHL=-76 
00000054  15:36:02  RT_Debug: QBC: Return: QBCropXM=0 QBCropYM=76 QBCropWM=0 QBCropHM=-76 
00000055  15:36:02  RT_Debug: QBC: Return: QBCropXP=2 QBCropYP=80 QBCropWP=-2 QBCropHP=-80  
00000056  15:36:02  RT_Debug: QBC: Return: QBCropThresh=48.000000
And the Log File written here as "Crop.Txt"

Code:
QBCropX=0 QBCropY=75 QBCropW=0 QBCropH=-76
QBCropXL=0 QBCropYL=72 QBCropWL=0 QBCropHL=-76
QBCropXM=0 QBCropYM=76 QBCropWM=0 QBCropHM=-76
QBCropXP=2 QBCropYP=80 QBCropWP=-2 QBCropHP=-80
QBCropThresh=48.000000
EDIT: Does not actually do the crop
EDIT: Now it does.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 2nd September 2012 at 14:29.
StainlessS is offline   Reply With Quote
Old 30th August 2012, 20:25   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,996
Or this script which scans all avi/mpg files in a directory and writes names and crop coords to a text file.

Code:
# EDIT To Suit

INFILE     =   "D:\VID\*.AVI|MP*G"                         # Video Directory and wildcards
OUTDIR     =   "D:\VID\"                                   # Directory for output Crop Log and Temp Files
OUTLOG     =   "CROP.TXT"                                  # Crop log
RELATIVE   =   True                                        # True show width as eg -8, False as eg 640
CROPCOORDS =   2                                           # 0=CropExact (RESIZE ONLY), 1=CropLess, 2=CropMore, 3=CropPlus
DEBUG      =   False                                       # Show output in DebugView
# ----------------------------------------------------------
GSCript("""
  LISTNAME = OUTDIR + "FILE.TXT"
  Result=RT_WriteFileList(INFILE,LISTNAME)                 # Write list file of video file names
  Assert((Result!=0), "No files found")
  FILELIST=RT_ReadTxtFromFile(LISTNAME)                    # Read list of names
  NFILES=RT_TxtQueryLines(FILELIST)                        # Number of files in list
  CROPTXT=""                                               # Init output log
  For(i=0,NFILES-1) {
    FN=RT_TxtGetLine(FILELIST,i)                           # The file name of video clip
    V=DirectshowSource(FN).ConvertToYV12()                 # Load file, Convert to whatever your required colorspace (affects cropping)
    QBC=V.QueryBorderCrop(relative=RELATIVE,debug=DEBUG)   # Inquire all modes cropping
    COORDS=RT_TxtGetLine(QBC,CROPCOORDS)                   # The cropping mode that is required
    WRCROP=String(i)+" ) "+COORDS+Chr(9)+FN                # Glue coords and filename together
    CROPTXT=RT_TxtAddStr(CROPTXT,WRCROP)                   # Add it to the log string
 }
 RT_TxtWriteFile(CROPTXT,OUTDIR+OUTLOG)                    # Write log file
""")
Return ColorBars()                                         # Dummy return clip
Crop Log

Code:
0 ) QBCropXM=18 QBCropYM=0 QBCropWM=-18 QBCropHM=0	D:\VID\1.mpg
1 ) QBCropXM=2  QBCropYM=0 QBCropWM=-2  QBCropHM=0	D:\VID\Lexx-S02xE01-Mantrid.avi
2 ) QBCropXM=2  QBCropYM=0 QBCropWM=-2  QBCropHM=0	D:\VID\Lexx-S02xE02-Terminal.avi
3 ) QBCropXM=6  QBCropYM=0 QBCropWM=-6  QBCropHM=-4	D:\VID\Lexx-S02xE03-Lyekka.avi
Modify it to output whatever format you like, eg batch file or multiple batch files, or batch of avs files.

EDIT: QueryBorderCrop(), comes with RT_Stats v1.03.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 30th August 2012 at 21:53.
StainlessS is offline   Reply With Quote
Old 31st August 2012, 14:22   #4  |  Link
gurusinghbrar
Registered User
 
Join Date: Jul 2012
Posts: 39
thanks @StainlessS for reply but idon't know more about this gscript, and how to use it with avisynth,, can u guide me how to use this with avisynth,,, and how to use this in dos batch file...
gurusinghbrar is offline   Reply With Quote
Old 31st August 2012, 21:05   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,996
GScript available here:-
http://forum.doom9.org/showthread.ph...hlight=gscript

To make a batch, you just need to have lines of the batch file broken up into string parts so that you can insert values
in between and join together into full line strings,
if more than one line batch file then, do the same with other lines and join together into a multiline string where each line
is separated by a linefeed [Chr(10)].
Then save the whole string to a file. Will take some work but assuming you can do a little Avisynth script, should not
be too difficult.

Good Luck.

EDIT: This function here by Vampiredom, could be VERY handy to do what you want.
http://forum.doom9.org/showthread.ph...hlight=gscript

Give me a little time and I'll show how you can use it.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 31st August 2012 at 21:19.
StainlessS is offline   Reply With Quote
Old 1st September 2012, 00:04   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,996
Try This:

Code:
# EDIT To Suit

DIR        =   "D:\VID\"                                   # Video Directory
INFILE     =   "*.AVI|MP*G"                                # Input file wildcards, AVI or MPG or MPEG
OUTDIR     =   "D:\OUT\"                                   # Output and Temp Directory
TEMPLATE   =   "D:\TEMT\TEMPLATE_AVS.TEMT"                 # AVS file TEMPLATE, could be DOS, or whatever.
OUTLOG     =   "OUTLOG.TXT"                                # Crop log
RELATIVE   =   True                                        # True show width as eg -8, False as eg 640
CROPCOORDS =   2                                           # 0=CropExact (RESIZE ONLY), 1=CropLess, 2=CropMore, 3=CropPlus
DEBUG      =   False                                       # Show output in DebugView
SIZEX      =   640                                         # Resize X size for AVS file
SIZEY      =   480                                         # Resize Y size for AVS file
# ----------------------------------------------------------

Function StrReplace(string s,string find,string replace){ # repeated, string replacements
# http://forum.doom9.org/showthread.php?t=147846&highlight=gscript     By Vampiredom, Gavino, IanB
i=s.FindStr(find) return(i==0?s:s.LeftStr(i-1)+replace+s.MidStr(Strlen(find)+i).StrReplace(find,replace))}

# ----------------------------------------------------------
GSCript("""
  LISTNAME = OUTDIR + "FILELIST.TXT"
  Result=RT_WriteFileList(DIR+INFILE,LISTNAME)             # Write list file of video file names
  Assert((Result!=0), "No files found")
  FILELIST=RT_ReadTxtFromFile(LISTNAME)                    # Read list of names
  NFILES=RT_TxtQueryLines(FILELIST)                        # Number of files in list
  TEMT=RT_ReadTxtFromFile(TEMPLATE)                        # Read Template avs/batch file.
  LOGTXT=""                                                # Init output log
  For(i=0,NFILES-1) {                                      # Step through list of file names
    FN=RT_TxtGetLine(FILELIST,i)                           # The file name of video clip including full path
    DirectshowSource(FN).ConvertToYV12()                   # Load file, Convert to whatever your required colorspace (affects cropping)
    QBC=QueryBorderCrop(relative=RELATIVE,debug=DEBUG)     # Inquire all modes cropping
    Eval(QBC)                                              # Set variables in Avisynth    
    COORDS=RT_TxtGetLine(QBC,CROPCOORDS)                   # The cropping mode that is required (2=CropMore)
    T=TEMT                                                 # Make a copy of the Template avs/batch
    # -----------------------------------------------------
    # Now we need to Edit the variables in copy of template file
    T=StrReplace(T,"[VideoFile]",FN)                       # Replace ALL occurences of video file name incl full path.
    T=StrReplace(T,"[SIZEX]",String(SIZEX))                # Resize X dim
    T=StrReplace(T,"[SIZEY]",String(SIZEY))                # Resize Y dim
    T=StrReplace(T,"[CROPX]",String(QBCROPXM))             # Crop X, in this case using CropMore
    T=StrReplace(T,"[CROPY]",String(QBCROPYM))             # Crop Y, in this case using CropMore
    T=StrReplace(T,"[CROPW]",String(QBCROPWM))             # Crop W, in this case using CropMore
    T=StrReplace(T,"[CROPH]",String(QBCROPHM))             # Crop H, in this case using CropMore
    # -----------------------------------------------------
    OFN = StrReplace(FN,DIR,"")                            # Out filename excluding Input dir path
    RT_TxtWriteFile(T,OUTDIR+OFN+".AVS")                   # Write AVS/Batch file to OUTDIR
    LOGTXT=RT_TxtAddStr(
        \ LOGTXT,
        \ String(i)+" ) "+FN,
        \ "Cropping = "+COORDS,
        \ "AVS File = "+OUTDIR+OFN+".AVS",
        \ "",
        \ T,
        \ "---------------"
    \ )
 }
 RT_TxtWriteFile(LOGTXT,OUTDIR+OUTLOG)                    # Write log file
""")
Return MessageClip (String(NFILES)+" Processed OK",width=320, height=200,shrink=false,text_color=$FFFF00,halo_color=$000000,bg_color=$5555FF)
FileList produced
Code:
D:\VID\1.mpg
D:\VID\Lexx-S02xE01-Mantrid.avi
D:\VID\Lexx-S02xE02-Terminal.avi
D:\VID\Lexx-S02xE03-Lyekka.avi
Outlog show all 4 Generated AVS files in one (I will not show them seperately, they are the same).
Code:
0 ) D:\VID\1.mpg
Cropping = QBCropXM=18 QBCropYM=0 QBCropWM=-18 QBCropHM=0
AVS File = D:\OUT\1.mpg.AVS

VideoFile="D:\VID\1.mpg"
DirectShowSource(VideoFile).ConvertToYV12().Trim(0,0)
Spline36Resize(640,480,18,0,-18,0)
Return Last
---------------
1 ) D:\VID\Lexx-S02xE01-Mantrid.avi
Cropping = QBCropXM=2 QBCropYM=0 QBCropWM=-2 QBCropHM=0
AVS File = D:\OUT\Lexx-S02xE01-Mantrid.avi.AVS

VideoFile="D:\VID\Lexx-S02xE01-Mantrid.avi"
DirectShowSource(VideoFile).ConvertToYV12().Trim(0,0)
Spline36Resize(640,480,2,0,-2,0)
Return Last
---------------
2 ) D:\VID\Lexx-S02xE02-Terminal.avi
Cropping = QBCropXM=2 QBCropYM=0 QBCropWM=-2 QBCropHM=0
AVS File = D:\OUT\Lexx-S02xE02-Terminal.avi.AVS

VideoFile="D:\VID\Lexx-S02xE02-Terminal.avi"
DirectShowSource(VideoFile).ConvertToYV12().Trim(0,0)
Spline36Resize(640,480,2,0,-2,0)
Return Last
---------------
3 ) D:\VID\Lexx-S02xE03-Lyekka.avi
Cropping = QBCropXM=6 QBCropYM=0 QBCropWM=-6 QBCropHM=-4
AVS File = D:\OUT\Lexx-S02xE03-Lyekka.avi.AVS

VideoFile="D:\VID\Lexx-S02xE03-Lyekka.avi"
DirectShowSource(VideoFile).ConvertToYV12().Trim(0,0)
Spline36Resize(640,480,6,0,-6,-4)
Return Last
---------------
Works pretty good.

EDIT: Oops, nearly forgot, here's the Template file, "TEMPLATE_AVS.TEMT"
Code:
VideoFile="[VideoFile]"
DirectShowSource(VideoFile).ConvertToYV12().Trim(0,0)
Spline36Resize([SIZEX],[SIZEY],[CROPX],[CROPY],[CROPW],[CROPH])
Return Last
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 1st September 2012 at 16:42.
StainlessS is offline   Reply With Quote
Old 1st September 2012, 16:05   #7  |  Link
gurusinghbrar
Registered User
 
Join Date: Jul 2012
Posts: 39
@stailless hey sory bro,, can't under stand how to use with avisynth please tel me to step to run this script with avs synth, i download the plugin and then install it in plugin and then "i dont know how to run this script in avisynth"
gurusinghbrar is offline   Reply With Quote
Old 1st September 2012, 16:10   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,996
Right click avs, select "Open With" and select a media player (NOT VLC, as it does all decoding internally and does not understand
AVS), eg Windows Media Player, Gom, MediaPlayer Classic Home Cinema, or whatever. Or in VirtualDub or any other program
that loads AVI files.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 1st September 2012, 16:16   #9  |  Link
gurusinghbrar
Registered User
 
Join Date: Jul 2012
Posts: 39
ok, let me explain, fist i install the plugin and then make a avs file and copy ur script in file.avs file, and then copy a avi video with in the same file.avs folder and then run the avs file in media player classic,, but it say error in line 58.
gurusinghbrar is offline   Reply With Quote
Old 1st September 2012, 16:19   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,996
See the script before "# ----------------------------------------------------------"

EDIT that to wherever your files are etc.

Code:
DIR        =   "D:\VID\"                                   # Video Directory
OUTDIR     =   "D:\OUT\"                                   # Output and Temp Directory
TEMPLATE   =   "D:\TEMT\TEMPLATE_AVS.TEMT"                 # AVS file TEMPLATE, could be DOS, or whatever.
You also need the Template file too, TEMPLATE_AVS.TEMT
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 1st September 2012 at 16:40.
StainlessS is offline   Reply With Quote
Old 1st September 2012, 16:35   #11  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,996
This works if you want everything in same directory

Code:
DIR        =   ".\"                                        # Video Directory
INFILE     =   "*.AVI|MP*G"                                # Input file wildcards, AVI or MPG or MPEG
OUTDIR     =   ".\"                                        # Output and Temp Directory
TEMPLATE   =   ".\TEMPLATE_AVS.TEMT"                       # AVS file TEMPLATE, could be DOS, or whatever.
".\" is current dir.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 1st September 2012 at 16:41.
StainlessS is offline   Reply With Quote
Old 1st September 2012, 16:42   #12  |  Link
gurusinghbrar
Registered User
 
Join Date: Jul 2012
Posts: 39
ok now new error ...

my avs file content is ...


LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ffms2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\AutoCrop.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_masktools-25.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_masktools-26.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE3.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RepairSSE3.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\GScript.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\LSFmod.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\ResizeKAR.avs")


DIR = ".\" # Directory
INFILE = "*.AVI|MP*G" # input file wildcards
OUTDIR = ".\" # Output and Temp Directory
TEMPLATE = ".\TEMPLATE_AVS.TEMT" # AVS file TEMPLATE, could be DOS, or whatever.
OUTLOG = "OUTLOG.TXT" # Crop log
RELATIVE = True # True show width as eg -8, False as eg 640
CROPCOORDS = 2 # 0=CropExact (RESIZE ONLY), 1=CropLess, 2=CropMore, 3=CropPlus
DEBUG = False # Show output in DebugView
SIZEX = 640 # Resize X size for AVS file
SIZEY = 480 # Resize Y size for AVS file
# ----------------------------------------------------------

Function StrReplace(string s,string find,string replace){ # repeated, string replacements
# http://forum.doom9.org/showthread.php?t=147846&highlight=gscript By Vampiredom, Gavino, IanB
i=s.FindStr(find) return(i==0?s:s.LeftStr(i-1)+replace+s.MidStr(Strlen(find)+i).StrReplace(find,replace))}

# ----------------------------------------------------------
GSCript("""
LISTNAME = OUTDIR + "FILELIST.TXT"
Result=RT_WriteFileList(DIR+INFILE,LISTNAME) # Write list file of video file names
Assert((Result!=0), "No files found")
FILELIST=RT_ReadTxtFromFile(LISTNAME) # Read list of names
NFILES=RT_TxtQueryLines(FILELIST) # Number of files in list
TEMT=RT_ReadTxtFromFile(TEMPLATE) # Read Template avs/batch file.
LOGTXT="" # Init output log
For(i=0,NFILES-1) { # Step through list of file names
FN=RT_TxtGetLine(FILELIST,i) # The file name of video clip including full path
DirectshowSource(FN).ConvertToYV12() # Load file, Convert to whatever your required colorspace (affects cropping)
QBC=QueryBorderCrop(relative=RELATIVE,debug=DEBUG) # Inquire all modes cropping
Eval(QBC) # Set variables in Avisynth
COORDS=RT_TxtGetLine(QBC,CROPCOORDS) # The cropping mode that is required (2=CropMore)
T=TEMT # Make a copy of the Template avs/batch
# -----------------------------------------------------
# Now we need to Edit the variables in copy of template file
T=StrReplace(T,"[VideoFile]",FN) # Replace ALL occurences of video file name incl full path.
T=StrReplace(T,"[SIZEX]",String(SIZEX)) # Resize X dim
T=StrReplace(T,"[SIZEY]",String(SIZEY)) # Resize Y dim
T=StrReplace(T,"[CROPX]",String(QBCROPXM)) # Crop X, in this case using CropMore
T=StrReplace(T,"[CROPY]",String(QBCROPYM)) # Crop Y, in this case using CropMore
T=StrReplace(T,"[CROPW]",String(QBCROPWM)) # Crop W, in this case using CropMore
T=StrReplace(T,"[CROPH]",String(QBCROPHM)) # Crop H, in this case using CropMore
# -----------------------------------------------------
OFN = StrReplace(FN,DIR,"") # Out filename excluding Input dir path
RT_TxtWriteFile(T,OUTDIR+OFN+".AVS") # Write AVS/Batch file to OUTDIR
LOGTXT=RT_TxtAddStr(
\ LOGTXT,
\ String(i)+" ) "+FN,
\ "Cropping = "+COORDS,
\ "AVS File = "+OUTDIR+OFN+".AVS",
\ "",
\ T,
\ "---------------"
\ )
}
RT_TxtWriteFile(LOGTXT,OUTDIR+OUTLOG) # Write log file
""")
Return MessageClip (String(NFILES)+" Processed OK",width=320, height=200,shrink=false,text_color=$FFFF00,halo_color=$000000,bg_color=$5555FF)



i make a folder and copy avi file in it and then create avs file above content and create TEMPLATE_AVS.TEMT with ur perameter and run avs file in media player say line
no function name "RT_Writefilelist" and line 70 error

check it out it say on """) error in avspmod

Last edited by gurusinghbrar; 1st September 2012 at 16:50.
gurusinghbrar is offline   Reply With Quote
Old 1st September 2012, 16:51   #13  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,996
The only plugins you need are GScript and RT_Stats (EDIT v1.03).
RT_Stats.dll is missing and also has the QueryBorderCrop.avsi script.
import the RT_Stats plugin just like the others,

You can use:-

Code:
Import("QueryBorderCrop.avsi")
maybe after load plugin lines to import the script from CURRENT directory.

I dont use AVSPmod, and almost always just have my plugins in the Avisynth plugin directory,
also the QueryBorderCrop.avsi in plugins dir.

EDIT: Also, you load Avisynth v2.58 and Avisynth v2.6 versions of mt_tools, pick one or the other
not both, and only 26 if you are using Avisynth v2.6, suggest remove 26 as it causes problems
in scripts because it removed planar YUY2 support.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 2nd September 2012 at 14:33.
StainlessS is offline   Reply With Quote
Old 1st September 2012, 16:58   #14  |  Link
gurusinghbrar
Registered User
 
Join Date: Jul 2012
Posts: 39
ok,,, where i can download RT_Stats.dll
gurusinghbrar is offline   Reply With Quote
Old 1st September 2012, 17:05   #15  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,996
http://forum.doom9.org/showthread.php?t=165479

Also see previous EDIT
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 1st September 2012 at 17:08.
StainlessS is offline   Reply With Quote
Old 1st September 2012, 17:18   #16  |  Link
gurusinghbrar
Registered User
 
Join Date: Jul 2012
Posts: 39
ok, stainless,, my avisynth version is 2.5.8 only,,, and can i use RT_stats.avs file instead of RT_stats.dll and put it in avisynth plugin... if yes i also done that but now it show syntex error in RT_stats.avs, line 3 ,colum 5
gurusinghbrar is offline   Reply With Quote
Old 1st September 2012, 17:24   #17  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,996
I've no idea what you called the provided script, I called mine crop.avs.
You need the RT_Stats.dll, the avs uses it.
You also need the QueryborderCrop.avsi as already stated. (Comes with the dll).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 1st September 2012, 17:27   #18  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,996
As it says in RT_Stats thread, you can download from my mediafire account in my sig, see below in red.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 1st September 2012, 17:29   #19  |  Link
gurusinghbrar
Registered User
 
Join Date: Jul 2012
Posts: 39
sorry for my english,,, its bad,,, ok i found the file.. RT_Stats.dll on net and replace it in same file where all files are placed.. and it say now nofile found.
gurusinghbrar is offline   Reply With Quote
Old 1st September 2012, 17:39   #20  |  Link
gurusinghbrar
Registered User
 
Join Date: Jul 2012
Posts: 39
huurry,,, i have done it,,, thanks man the file log have out is created... my mistake was, i was using the old RT_stats.dll file but replace with new which download from your sig it works...

"i know i am "Pig" but i can dance very well,,, if u teach me,,, because no body is perfect from birth"

do u faver me one more tiime... can u help me more,,, how to these file value import in batch file for processing...

Last edited by gurusinghbrar; 1st September 2012 at 17:45.
gurusinghbrar is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:46.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.