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 > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th March 2012, 03:23   #1  |  Link
TwoToad
Registered User
 
TwoToad's Avatar
 
Join Date: Oct 2005
Posts: 74
AutoCrop script?

Hello, I'm trying to encode a series that was made in the late 70's and looks like it was a VHS transfer to DVD. My problem is that each scene seems to have different crop values. Currently this method works great:

trim(0,1000).crop(24,0,-10,0).resize(640,480) ++ trim (1001,2000).crop(20,0,-8,0).resize(640,480) ++ ... etc

Obviously this becomes extremely tedious for a 21 episode series and is prone to human error.

AutoCrop from len0x does not solve the problem because it finds 1 crop value and applies it to the whole video.

I don't suppose there is a simple script that would loop through each frame to determine it's crop value, resize, and go on to the next frame? Something like

for i = 0 to lastframe
autocrop(samplestartframe=i, sampleendframe=i).resize(640,480)
next i

I'm not sure if something like that would work. I don't speak enough avisynth-ese yet to make it into a function, and I'm not sure exactly how slow this would be but it's an idea anyway.

Anyone able to translate something like this into an avisynth function script? Or any thoughts? Obviously it would be fleshed out with parameters to choose your resizing filter and dimentions, along with any other parameters you'd need.
TwoToad is offline   Reply With Quote
Old 9th March 2012, 10:09   #2  |  Link
nodunlop
Registered User
 
Join Date: Mar 2012
Posts: 1
Maybe you can adapt this code snippet for that purpose.

Code:
frame = 1
last = movie.FrameCount()
video = AutoCrop(movie.trim(0,0),0,716,424,0,0,0,0,30,1,0,0,0)

GScript("""
  while (frame < last ) {
  video = video ++ AutoCrop(movie.trim(frame,frame),0,716,424,0,0,0,0,30,1,frame,frame,0)
  frame = frame + 1
  }
""")
nodunlop 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 02:48.


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