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 > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th December 2017, 10:21   #1  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
How do I draw vertical and horizontal line across the frame?

I'm trying to sync 2 videos with different display ratio (16:9 and 4:3) in my editing and I'm having trouble finding the sync point on all vertical and horizontal panning shots. I need guide lines to indicate the center point of the frame, so I need draw a horizontal and vertical line across the middle of the frame to find that point. Right now I'm physically measuring my monitor with a ruler to do this.
lansing is offline   Reply With Quote
Old 12th December 2017, 13:10   #2  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
Not the prettiest in the world but in most cases, it should work.


Code:
def draw_guide(clip):
    h_line = []
    h_white = core.std.BlankClip(width=clip.width, height=clip.height/2-1, format=vs.GRAY8, color=255)
    h_line.append(h_white)
    h_line.append(core.std.BlankClip(width=clip.width, height=2, format=vs.GRAY8, color=0))
    h_line.append(h_white)

    v_line = []
    v_white = core.std.BlankClip(width=clip.width/2-1, height=clip.height, format=vs.GRAY8, color=255)
    v_line.append(v_white)
    v_line.append(core.std.BlankClip(width=2, height=clip.height, format=vs.GRAY8, color=0))
    v_line.append(v_white)

    guide = core.std.Expr([core.std.StackVertical(h_line), core.std.StackHorizontal(v_line)], 'x y min')

    result = core.std.MaskedMerge(clip, core.resize.Bicubic(guide, format=clip.format), core.std.Invert(guide))

    return result
Are_ is offline   Reply With Quote
Old 12th December 2017, 14:11   #3  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
You can also use the vector drawing stuff in the ASS subtitle format for things like these if you want, that's probably easier to deal with. Probably not faster though, but you never know.
TheFluff is offline   Reply With Quote
Old 12th December 2017, 16:05   #4  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by Are_ View Post
Not the prettiest in the world but in most cases, it should work.
Thanks, it works, that's good enough for me.
lansing is offline   Reply With Quote
Old 12th December 2017, 18:22   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
A bit OT but related.
In Avisynth, vcMohan has a Grid() function (draws graticule on frame), is quite handy in some circumstances.
I assume that same exists in his VS plugs.

EDIT: Example image here:- https://forum.doom9.org/showpost.php...6&postcount=90

EDIT: I guess that it could be persuaded to do close to that required in this thread.
__________________
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; 14th December 2017 at 01:40.
StainlessS 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 06:11.


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