VideoHelp Forum
+ Reply to Thread
Results 1 to 20 of 20
Thread
  1. To draw attention to an area in a video I often simply fade in an empty rectangle around it. But sometimes I'd like to draw the rectangle. My NLE, Magix Movie Edit Pro 2014, has no built-in tool or video clip for this. So I made this simple one myself and it's quite useful.

    https://www.dropbox.com/s/wepis0jtihtht3v/Rectangle-1.wmv?dl=0

    But I'd prefer a rounded rectangle. That's proving much trickier to make with the method I used for the basic rectangle (careful keyframe animation of four lines). My searches for a video clip have so far been unsuccessful, so I'm hoping someone here can point me to one please.

    --
    Terry, East Grinstead, UK
    Quote Quote  
  2. Can't you just do that in photoshop / gimp / image editor of your choice ? eg. you can do it with alpha channel (transparency) as an overlay , so only the shape is visible if that' s what you want (or maybe you wanted "black"?)

    I'm not too familiar with Magix, but you can do it as a "mask reveal" in most NLE's. This technique allows you to do any shape
    Quote Quote  
  3. I did this with a couple images and an AviSynth script:
    Image Attached Files
    Quote Quote  
  4. Originally Posted by poisondeathray View Post
    Can't you just do that in photoshop / gimp / image editor of your choice ? eg. you can do it with alpha channel (transparency) as an overlay , so only the shape is visible if that' s what you want (or maybe you wanted "black"?)
    PaintShop Pro handles alpha channel transparency and I use it frequently. But I don't see how to re-create an animated video effect like the one I uploaded with a static image editor?

    I'm not clear what you mean about 'wanting black'? I want the red line to draw exactly as it does in the one I made. Naturally with a pure black background so that it can be made transparent. (In MEP, that's by setting Chroma Key to Black.)


    I'm not too familiar with Magix, but you can do it as a "mask reveal" in most NLE's. This technique allows you to do any shape
    That's OK for lines and curves that don't double back and touch, but I've had no success so far with the reveal technique for a tightly rounded rectangle.

    Perhaps naively, I'd assumed such clips were in widespread use and was hoping to simply download one as an MP4, WMV, AVI or any other format I can import in MEP 2014.

    --
    Terry, East Grinstead, UK
    Quote Quote  
  5. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    In Photoshop you could use a brush tool to draw a rectangle from a template in a layer underneath or a prior made selection and take frequent "snapshots" to make an animation. Then you make a selection, make the selection transparent with optionally some feathering and export as a video. Then you can import this in Premiere as a layer.

    The drawing of the rounded rectangle can be done similar to this:

    https://www.youtube.com/watch?v=W88JZ6uLE_k
    Quote Quote  
  6. Originally Posted by jagabo View Post
    I did this with a couple images and an AviSynth script:
    Thanks, appreciate your taking the time. But AviSynth is outside my skill set, if you'd intended I should try making one myself that way? Also I don't see how I could use that in practice, given that it doesn't have a pure black background? How would I fully remove that dark grey in all situations? I can't play with it in MEP to check anyway, as MKV is not a supported import format. It also doesn't match the one I made in a couple of other respects:
    1. I'm sure the permanent black outline would be faintly visible immediately, rather spoiling the 'drawing' effect.
    2. Unlike the template I uploaded, yours draws unnaturally in two directions simultaneously.

    --
    Terry, East Grinstead, UK
    Quote Quote  
  7. Originally Posted by newpball View Post
    In Photoshop you could use a brush tool to draw a rectangle from a template in a layer underneath or a prior made selection and take frequent "snapshots" to make an animation. Then you make a selection, make the selection transparent with optionally some feathering and export as a video. Then you can import this in Premiere as a layer.

    The drawing of the rounded rectangle can be done similar to this:

    https://www.youtube.com/watch?v=W88JZ6uLE_k
    Thanks. OK, I could do all that in PaintShop Pro and I guess a large number of snapshots might yield a usable smooth video clip. But what a lot of work! As mentioned, I used simple KFA in MEP 2014 to make my plain (sharp-cornered) rectangle, and that took a fair while. As per my reply to poisonray, I'm hoping for a URL to a ready-made clip in a standard format.

    --
    Terry, East Grinstead, UK
    Quote Quote  
  8. Originally Posted by terrypin View Post

    That's OK for lines and curves that don't double back and touch, but I've had no success so far with the reveal technique for a tightly rounded rectangle.

    Perhaps naively, I'd assumed such clips were in widespread use and was hoping to simply download one as an MP4, WMV, AVI or any other format I can import in MEP 2014.
    The mask reveal is how it's typically done - if you want to "write" a signature, draw various shapes, etc...

    You're correct that if lines loop over or double back/ touch, it wont work very well (e.g. in a signature, the letter "o" might have overlaps") ; because you might "reveal" content later on in time prematurely. The workaround is to do this in layers. Yes - It can get tricky if you have complex interwoven shapes and there are other methods to do this

    But how is your "rounded rectangle" an example of overlap , or tight turns ? This is (almost) as easy as a straight line.

    Can your program draw bezier splines ? Does it have a "pen tool" that you can click and make points ?




    If you just want someone to do it for you, it's trivial to do in other programs, just let me know what specs you want it (framerate, dimensions, etc...), what shape, what color etc....timing, duration, speed. Be descriptive as possible because I'm only going to do it once. Even post what you want exactly as a still image from an image editor and describe how you want it revealed . But I'd rather have you learn the technique so it gives you the flexibility to do other things and apply to other situations
    Last edited by poisondeathray; 30th Oct 2014 at 14:17.
    Quote Quote  
  9. Originally Posted by poisondeathray View Post

    If you just want someone to do it for you, it's trivial to do in other programs, just let me know what specs you want it (framerate, dimensions, etc...), what shape, what color etc....timing, duration, speed. Be descriptive as possible because I'm only going to do it once. Even post what you want exactly as a still image from an image editor and describe how you want it revealed . But I'd rather have you learn the technique so it gives you the flexibility to do other things and apply to other situations
    Thanks a bunch, that's a very kind offer!

    I want it to look exactly like the sharp-cornered rectangle I made, but with tightly rounded corners:

    https://www.dropbox.com/s/62swcjy5frbj4ls/RoundedRectangle-1.jpg?dl=0

    Direction of drawing preferably clockwise, from top-left. background black. Like mine, it should be drawn at a uniform speed, lasting say 4 seconds. I can alter speed and colour in MEP after placing the clip on the timeline and making it transparent.

    I made mine with 1280 x 720 resolution but when I redo it I'll go for 1920 x 1080, just to avoid MEP's message asking me if I want to adjust to my project resolution, which is almost always 1920 x 1080. So I'd like the rounded version at 1920 x 1080 too please. Frame rate is 25 fps.

    Please let me know if you need more information.

    --------------------

    In parallel I'll have another go at it myself.

    --
    Terry, East Grinstead, UK
    Last edited by terrypin; 30th Oct 2014 at 15:01.
    Quote Quote  
  10. Ok no problem

    There are no "sharp" or tight corners on your jpg

    This is 1920x1080 25p , lagarith RGBA
    Image Attached Files
    Quote Quote  
  11. Originally Posted by terrypin View Post
    Originally Posted by jagabo View Post
    I did this with a couple images and an AviSynth script:
    Thanks, appreciate your taking the time. But AviSynth is outside my skill set, if you'd intended I should try making one myself that way?
    I meant it as an example of a different way of drawing that didn't require a complex mask or complex motion. It only uses a diagonal mask that moves diagonally.
    Last edited by jagabo; 30th Oct 2014 at 16:08.
    Quote Quote  
  12. Originally Posted by poisondeathray View Post
    Ok no problem

    There are no "sharp" or tight corners on your jpg

    This is 1920x1080 25p , lagarith RGBA
    Wow, that was quick! You're a star, thanks a lot. Works a treat

    What sort of mask did you make to handle the reveal? Did you move it with key framing?

    --
    Terry, East Grinstead, UK
    Quote Quote  
  13. Originally Posted by terrypin View Post
    Originally Posted by poisondeathray View Post
    Ok no problem

    There are no "sharp" or tight corners on your jpg

    This is 1920x1080 25p , lagarith RGBA
    Wow, that was quick! You're a star, thanks a lot. Works a treat

    What sort of mask did you make to handle the reveal? Did you move it with key framing?

    I actually "cheated" and used after effects and the "stroke" effect because it's a even quicker to do there

    But in general, to do the mask reveal, you just keyframe the mask reveal layer. If you have complex shapes, graphics, lines, whatever, often you have to break it up and do multiple layer reveals


    And I guess you could call a 90 degree "corner" sharp, but in the context of how this technique is usually done, that is not sharp at all . When you have acute angles, such as 10 degrees, sharp vertices, like the letter "V" - that's where you run the risk of overlapping the reveal. Or especially handwritten text with big looping letters that circle and cross back over - those are more challenging scenarios
    Quote Quote  
  14. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    Another way of doing this is to create the rounded rectangle in Photoshop, cover it with a transparent layer. Then start a session in CamStudio (don't track the mouse) and then use a brush on that layer to cover the rectangle backwards. After that reverse the video and then you might want to remove some frames to get a constant speed.

    Like so (in 60p ):

    https://www.youtube.com/watch?v=V-B0s04lFfM&list=UUqDYLFLtjw7_TT7Be01qkog

    Last edited by newpball; 30th Oct 2014 at 17:20.
    Quote Quote  
  15. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    ...A little late now (wrote this hours ago, then had to leave before posting), but here was my suggestion:
    Photoshop, etc: Rectangular selection w/ small feathering, Modify Selection|Smooth: large value, Stroke: medium value w/ chosen color. Save w/ selection as mask/alpha, Save file to PNG w/ transparency.
    Then, position with keyframing and use a radial wipe reveal in your NLE.

    Scott
    Quote Quote  
  16. ^Nice, Scott's idea is even easier. Because this is such a "simple" shape, you can really treat it as a circle. You could do rectangle/square even triangles with that as well
    Quote Quote  
  17. Thanks all.

    @newpball: That's a method I've used occasionally in Paintshop Pro to draw tracks on my maps, recording with CamStudio 2. But I'd thought it would be difficult to get a smooth result, especially going around the corners. No big deal for twisty hikes but not so good for this 'highlighting' use.

    Scott: Will definitely try that asap, thanks.

    --
    Terry, East Grinstead, UK
    Quote Quote  
  18. oops I actually uploaded an RGB version, not RGBA (alpha) version above , but I'm sure you figured it out when you had to key out the black. I uploaded the proper RGBA one below

    Just about every NLE has a radial wipe effect, but here is an avisynth version , using the radial wipe idea from Scott . It uses the same still frame which can done in any image editor. The leading edge angle changes and is linear (not a rounded edge, as if you were using a pen tip) . You could feather the edge more by blurring the mask edge more.

    It uses the same mask reveal concept, but in the form of a white circle. This type of "mask reveal" is also known as a "luma matte" or "luma mask" in some NLE's. Areas in 100% white are transparent, or fully revealed. Areas in 100% black are completely not revealed. Shades of gray are in between for transparency. They are called "mask reveals" because the rectangle, or shape, or signature, or whatever is already there on the background layer. That's the thing you made in photoshop or image editor. Earlier you asked : "But I don't see how to re-create an animated video effect like the one I uploaded with a static image editor? " . So it's not really animating, it's the mask that is animating, revealing the still image as the background layer

    Here is an animated gif for illustrating the luma mask
    Name:  avisynth_radialwipe_mask_reveal.gif
Views: 559
Size:  22.9 KB

    Interestingly, I couldn't find an existing proper "radial wipe" filter in avisynth. I found "clockwipe" , and "circlewipe", but they were very buggy and didn't produce proper results on the end frames, so a workaround with scriptclip was used to accumulate the rotation. scriptclip can be buggy too if you do random seeks (you have to go from start to finish linearly)

    Code:
    orig=ImageSource("rgba.png", pixel_type="RGB32").Trim(0,100).AssumeFPS(25).Crop(640,220,-640,-220,true)
    black=blankclip(orig)
    
    whitebar=blankclip(101,32,320,"RGB32",color=$FFFFFF,fps=25)
    smallblack=blankclip(101,640,640,fps=25)
    overlay(smallblack, whitebar, x=304)
    rotate(-40,0,0,100,320)
    blur(1.5,1.5)
    rot=last
    
    b=blankclip(rot)
    ScriptClip("""
      b = b.Loop(2,0,0).Overlay(last, mode="lighten")
      return b
    """)
    mymask=last
    
    black.trim(0,-1) ++ overlay(black, orig, mask=mymask)
    addborders(640,220,640,220)
    Image Attached Thumbnails Click image for larger version

Name:	rgba.png
Views:	376
Size:	11.5 KB
ID:	28248  

    Image Attached Files
    Last edited by poisondeathray; 30th Oct 2014 at 23:54.
    Quote Quote  
  19. Originally Posted by Cornucopia View Post
    ...A little late now (wrote this hours ago, then had to leave before posting), but here was my suggestion:
    Photoshop, etc: Rectangular selection w/ small feathering, Modify Selection|Smooth: large value, Stroke: medium value w/ chosen color. Save w/ selection as mask/alpha, Save file to PNG w/ transparency.
    Then, position with keyframing and use a radial wipe reveal in your NLE.

    Scott
    Excellent, thanks a bunch Scott. Once I found MEP's radial wipe (labelled as a 'Clock' effect) that proved every bit as straightforward as you and poisondeathray said.

    Learned a lot from this thread, appreciate everyone's help.

    --
    Terry, East Grinstead, UK
    Quote Quote  
  20. I thought someone might find this interesting...

    Originally Posted by Cornucopia View Post
    use a radial wipe reveal in your NLE.[/INDENT]Scott
    My original idea was to use a radial wipe. But AviSynth doesn't have that. And I wanted to use only two images to perform the animation. So I needed a circle with a circumferential ramp. A quick search didn't turn up any such images and I was too lazy to write a program to make one. But poisondeathray's animated gif gave me a way to make one -- just blend all the frames together into one image.

    So starting with a white box on a black backrgound:
    Name:  rect.png
Views: 524
Size:  75.4 KB

    And a circumferential ramp (built with a small modification of pdr's script, and merging all the frames into one):
    Click image for larger version

Name:	ramp.png
Views:	215
Size:	45.6 KB
ID:	28264

    And this fairly simple script:
    Code:
    function AnimateBinarize(clip vid, int threshold)
    {
        mt_binarize(vid, threshold)
    }
    
    ColorBars(width=680,height=480, pixel_type="YV12")
    rect = ImageSource("rect.png").ConvertToYV12(matrix="PC.601")
    black = BlankClip(rect).ColorYUV(cont_y=32)
    red = BlankClip(rect, color=$ff0000)
    ramp = ImageSource("ramp.png").ConvertToYV12(matrix="PC.601").BilinearResize(rect.width, rect.height)
    
    amask = Animate(0,50, "AnimateBinarize", ramp,0, ramp,255).Invert()
    omask = Overlay(black, rect, mask=amask).GreyScale()
    
    Overlay(last, red, 100, 100, omask)
    Overlay(last, red, 300, 300, omask)
    
    Trim(0,50)
    I produced the attached animation. ColorBars() was used to produce a background video on which to overlay the boxes. mt_binarize() was used to convert the circumferential ramp into an animated two tone (black, white) mask. That mask was used to animate the rectangle mask. Finally a red image was overlaid onto the video via the animated rectangle mask, in two different locations.
    Image Attached Files
    Last edited by jagabo; 31st Oct 2014 at 10:10.
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!