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. |
23rd February 2014, 12:45 | #1 | Link |
Registered User
Join Date: Jul 2011
Posts: 1,121
|
My Script is not working, Exceptions
I am trying to use a script, which simply will resize an area (containing a timestamp) and than use overlay to put it on the video, meaning only that part is resized to maintain certain quality.
But i get exceptions, and have no idea why. http://www.sendspace.com/file/bxe63b Code:
c=Avisource("test.avi") c timer=Crop(0, 470, -586, 0).Overlay(BlankClip(length=framecount(last), width=2, height=8, pixel_type="RGB32", fps=framerate(last), fps_denominator=1, audio_rate=44100, channels=1, sample_type="16bit", color=$000000), x=57, y=00, opacity=1.0, mode="blend", greymask=true, ignore_conditional=false, pc_range=false) c.Crop(16, 10, -16, -14).AddBorders(16, 10, 16, 14, color=$000000).Spline64Resize(1280,720, src_left=0.0, src_top=0.0, src_width=0.0, src_height=0.0) # ConvertToYV12(matrix="Rec601", interlaced=false) Overlay( timer.PointResize(Width(timer)*2, Height(timer)*2, src_left=0.0, src_top=0.0, src_width=0.0, src_height=0.0), x=0, y=Height(last)-Height(timer)*2, opacity=1.0, mode="blend", greymask=true, ignore_conditional=false, pc_range=false) |
23rd February 2014, 13:19 | #4 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Your script works for me with Avisynth 2.6. However, it crashes with the latest AVS+ (MT). Post this in the AVS+ thread, assuming you are indeed using AVS+.
Last edited by Groucho2004; 23rd February 2014 at 13:21. |
23rd February 2014, 18:05 | #9 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
First thing to do was format it with line breaks. It works for me (avisynth 2.6) but I don't think it should.
src_width=0.0, src_height=0.0 does not sound right. No mention of this argument in the wiki, so I don't know. Code:
c=Avisource("test.avi") c timer=Crop(0, 470, -586, 0) /* note Last must be > 470x586 */ \ .Overlay( \ BlankClip(length=framecount(last), \ width=2, height=8, pixel_type="RGB32", \ fps=framerate(last), fps_denominator=1, \ audio_rate=44100, channels=1, sample_type="16bit", \ color=$000000), \ x=57, y=00, \ opacity=1.0, mode="blend", \ greymask=true, \ ignore_conditional=false, pc_range=false) /* return Last ## 1280x720 */ /* return timer ## 694x250 */ c.Crop(16, 10, -16, -14) \.AddBorders(16, 10, 16, 14, color=$000000) \.Spline64Resize( \ 1280, 720, \ src_left=0.0, src_top=0.0, \ src_width=0.0, src_height=0.0) /* what is this? */ # ConvertToYV12(matrix="Rec601", interlaced=false) /* return Last ## 1280x720 */ Overlay( \ timer.PointResize( \ Width(timer)*2, Height(timer)*2, \ src_left=0.0, src_top=0.0, \ src_width=0.0, src_height=0.0), /* what is this? */ \ x=0, y=Height(last)-Height(timer)*2, \ opacity=1.0, mode="blend", \ greymask=true, \ ignore_conditional=false, pc_range=false) return Last ## 1280x720 Last edited by raffriff42; 23rd February 2014 at 18:07. Reason: typo |
23rd February 2014, 18:26 | #12 | Link | |
Registered User
Join Date: Oct 2011
Posts: 52
|
Quote:
As does most of the script. It boils down to this: Code:
timer=Crop(0, 470, 58, 0).AddBorders(0,0,50,0) Spline64Resize(1280,720) Overlay(timer.PointResize(timer.Width*2, timer.Height*2), y=Height-timer.Height*2) Code:
timer=PointResize(116, 20, 0, 470, 58, 0).AddBorders(0,0,100,0) Spline64Resize(1280,720) Overlay(timer, y=Height-timer.Height) Code:
ow = 1280 oh =720 ty = 470 tw = 58 timer=PointResize(tw*2, (Height-ty)*2, 0, ty, tw, 0).AddBorders(0,0,ow-tw*2,0) StackVertical(Spline64Resize(ow,oh,0,0,0,ty),timer) Last edited by zero9999; 23rd February 2014 at 19:52. |
|
23rd February 2014, 18:47 | #13 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
src_width and src_height do not default to zero, but to the input width and height respectively. Of course, if src_left and src_top are both zero (their defaults), then (and only then) the default values for src_width and src_height have the same effect as zero.
|
24th February 2014, 01:40 | #14 | Link | |
Registered User
Join Date: Jul 2011
Posts: 1,121
|
It seems to work with the latest version:
Quote:
|
|
24th February 2014, 06:56 | #15 | Link | |
Registered User
Join Date: Oct 2011
Posts: 52
|
Quote:
just use the last code snippet and increase the tw parameter as you see fit. |
|
25th February 2014, 10:24 | #16 | Link | |
Registered User
Join Date: Jul 2011
Posts: 1,121
|
The purpose was simply to put black on a place that was showing the clip, there was a glap to cover up.
Anyhow, i am getting problems with exceptions still, but other causes, and i think you can produce it simply with Blankclips as well. Can anyone try this: Quote:
So please try with Avspmod and see if it returns an exception (a text log opens up instead of the actual video preview). Last edited by zerowalker; 25th February 2014 at 10:27. |
|
27th February 2014, 04:06 | #19 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
Pay attention to your error messages. They can be very helpful. These are from my VirtualDub log:
Code:
[E] Error: Avisynth open failure: Splice: Frame sizes don't match (D:\VideoProjects\_scripts\test_05.avs, line 63) . . . [E] Error: Avisynth open failure: Splice: Video formats don't match (D:\VideoProjects\_scripts\test_05.avs, line 63) Problem 2: Last=YV12, intro=RGB32; can't splice 'em. Arguments that duplicate the defaults do nothing but invite error; they have been commented out. Code:
c=BlankClip(length=240, width=720, height=480, pixel_type="RGB32", fps=24.0, \ fps_denominator=1, audio_rate=44100, channels=1, sample_type="16bit", color=$000000) c timer=Crop(0, 470, -600, 0).Overlay(Last.BlankClip(/*length=framecount(last), */width=7, \ height=8/*, pixel_type="RGB32", fps=framerate(last), fps_denominator=1, audio_rate=44100, \ channels=1, sample_type="16bit", color=$000000*/), x=57, y=00/*, opacity=1.0, mode="blend", \ greymask=true, ignore_conditional=false, pc_range=false*/) Crop(16, 0, -16, -0) AddBorders(16, 0, 16, 0, color=$000000) Spline64Resize(1280,720) ConvertToYV12(matrix="Rec601"/*, interlaced=false*/) Overlay( \ timer.PointResize(Width(timer)*2, Height(timer)*2/*, src_left=0.0, src_top=0.0, src_width=0.0, src_height=0.0*/), \ x=0, y=Height(last)-Height(timer)*2/*, opacity=1.0, mode="blend", greymask=true, \ ignore_conditional=false, pc_range=false*/) intro=Last.BlankClip(length=240/*, width=1280, height=72, pixel_type="RGB32", \ fps=24.0, fps_denominator=1, audio_rate=44100, channels=1, sample_type="16bit", color=$000000*/) intro++last Last edited by raffriff42; 27th February 2014 at 04:31. |
Thread Tools | Search this Thread |
Display Modes | |
|
|