VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Page 1 of 4
1 2 3 ... LastLast
Results 1 to 30 of 114
Thread
  1. It's easy enough to make the background of a still image transparent, by adding it in an image editor and saving it as a PNG . But how do you do this for a video? I appreciate details will vary by NLE (mine is Magix Movie Edit Pro 2013 Premium) but I'm sure the principle must be common?

    Take the simplest possible example, namely a white object on a black background. Such as this clip downloaded from
    http://www.motionbackgroundsforfree.com/technology-free-backgrounds/free-technology-ba...-passing-time/

    I wanted a simple clock to occasionally drop into my holiday DVDS. Although this one is OK, I'm not completely satisfied and have been trying to make my own. But I don't see how to make one that I can then just import into any project without the extra step of specifying the transparency. In MEP it's via Video Effects > Chroma Key, and then choosing Black in this example.

    But all these downloadable videos do it with no such extra step. It appears to have its transparent background already embedded and recognised immediately by the video editor. How are they made please?

    --
    Terry, East Grinstead, UK
    Quote Quote  
  2. It's analgous to the image editor example. It's really the same thing

    You save a video with an alpha channel that specifies the transparency (that is the transparent background information). Similarly , you save the PNG with alpha in the image editor

    Only some video formats support alpha channel. (RGB + A, where A is the alpha) . Commonly used ones quicktime animation, lagarith, ut video codec, or even image sequences.

    Once the video is saved with that alpha channel, you can drop that video on any NLE , and the background will be transparent

    If your question was how to generate the transparency in the first place, you already know about keying, but you can also do masking, create layers, many ways . So you could design your own clock and specify the transparency, then save it out with the alpha channel
    Quote Quote  
  3. With simple black on white (or any bright on dark) video like the one you linked to you can often use a contrast stretch to create an alpha mask:

    Code:
    clock = ffVideoSource("Free Technology Background _Passing Time_ (720p).mp4") # the clock video
    alpha = ColorYUV(clock,cont_y=500) # create an alpha channel from the clock video
    bars= ColorBars(1280,720).ConvertToYV12() # just some video onto which we'll overlay the clock
    Overlay(bars,clock,0,0,alpha)
    Click image for larger version

Name:	ovr.jpg
Views:	536
Size:	42.1 KB
ID:	18695

    I didn't bother to clean out the red text overlay at the bottom of the clock.
    Quote Quote  
  4. jagabo: Thanks, but you're a thousand miles outside my know-how level! What is this code and when and where are you entering it? What sort of file have you exported with it, from what program?

    --
    Terry, East Grinstead, UK
    Quote Quote  
  5. Originally Posted by poisondeathray View Post
    It's analgous to the image editor example. It's really the same thing

    You save a video with an alpha channel that specifies the transparency (that is the transparent background information). Similarly , you save the PNG with alpha in the image editor

    In my image editor (PaintShop Pro 8) that's all clearcut, as shown in my screenshot earlier. I can also do it from IrfanView, although that's inferior as it doesn't allow a tolerance setting, so you get this sort of result:
    https://dl.dropboxusercontent.com/u/4019461/Day3-Clock1-IV.png


    But the penny hasn't dropped how to do the equivalent in MEP. I'm assuming it must be something I set in the Export dialogs. But despite my long experience with MEP I've not see anything obviously relevant.


    Only some video formats support alpha channel. (RGB + A, where A is the alpha) . Commonly used ones quicktime animation, lagarith, ut video codec, or even image sequences.
    Ah, OK, maybe that's part of my problem. 99% of my exports, including all my recent experiments with this stuff, are to MP4. That clock download came in two flavours, AVI (as uploaded earlier) and MOV. Media Info reports the AVI as Format: JPEG, Codec ID: MJPG and the MOV as Format: JPEG, Codec ID: jpeg, although Gspot says the MOV is 'Apple Photo JPEG', if that's of any relevance!

    Once the video is saved with that alpha channel, you can drop that video on any NLE , and the background will be transparent
    Yep, that's my goal.

    If your question was how to generate the transparency in the first place, you already know about keying, but you can also do masking, create layers, many ways . So you could design your own clock and specify the transparency, then save it out with the alpha channel
    I know about masking and layers but as you now see it's 'specify the transparency, then save it out with the alpha channel' that's so far eluded me. I'll load up MEP and have another crack at it shortly.

    --
    Terry, East Grinstead, UK
    Quote Quote  
  6. ok, I don't use MEP , but we should be able to figure it out

    When you key something out, there should be an option to see a transparency grid (instead of "black", it will look like a grey & white checkerboard over sections that are "transparent") . That's how you know what sections are "transparent"

    When you export, you have to specify the alpha channel in the export option. In most programs it will say something like "RGB + A". If you can look at the manual or post screenshots of the configuration it might help

    Photo-jpeg typically isn't used by people, because it's not lossless . More common would be quicktime animation codec, or quicktime PNG if you wanted MOV container

    For example , if you use lagarith AVI, you have to specify the alpha in the configuration - under "mode" you would select "RGBA" instead of "RGB", or "YV12", or "YUY2"
    Quote Quote  
  7. Originally Posted by terrypin View Post
    jagabo: Thanks, but you're a thousand miles outside my know-how level! What is this code and when and where are you entering it? What sort of file have you exported with it, from what program?
    It's an AviSynth script. I created it with Notepad. Then I opened the script in VirtualDub to make the screen cap. The script doesn't export the alpha mask itself, it just creates it and uses it. It would have to be modified a bit to output the clock image and alpha mask in ARGB format:

    Code:
    clock = ffVideoSource("Free Technology Background _Passing Time_ (720p).mp4")
    alpha = ColorYUV(clock,cont_y=500)
    clock = ConvertToRGB32(clock)
    MergeARGB(alpha, clock, clock, clock)
    Then open that in a program that accepts ARGB and save the video. 10 frame sample attached.
    Image Attached Files
    Last edited by jagabo; 4th Jul 2013 at 11:55.
    Quote Quote  
  8. Thanks for your latest helpful reply, but ...

    Just received a very prompt and detailed reply from a friend in Magix Support. It starts:

    "I'm afraid this isn't something that has eluded you. It's simply something that isn't possible with our video software to the degree that you would require here."

    Small wonder I couldn't do it then!

    Later he says
    "What you are essentially looking for is alpha channel support. It's basically transparency for motion video material and does, of course, play a role in the realm of stock video material and compositing. It is supported by certain video types/containers, some of which we support on export, but unfortunately we don't support the encoding of material with a defined alpha channel."

    More positively he does go on to suggest two other interesting compromise solutions. I could create the animation in a suitable program and opt for animated GIF as the intermediate format, as MEP does support transparency on GIFs. Or I could use the built in Xara program
    which has some animation capabilities. I'd bring in the XAR files, as MEP fully supports their transparency.

    If I don't go down either of those routes (curiosity would be my only serious motive), it seems I'm limited to chroma-keying for this sort of thing. Disappointing, but no great hardship for the sort of videos I make. For the immediate task of my clock, I'll either settle for what I've done or search a bit more for a better clip.

    Many thanks for your help.

    --
    Terry, East Grinstead, UK
    Quote Quote  
  9. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Or you could get better software. Like Vegas Movie Studio even, which IIRC can do that. I'm actually quite disappointed to find MEP don't support that!

    Scott
    Quote Quote  
  10. Congratulations Terry, you've outgrown your NLE. Buy yourself Vegas or Premiere as a graduation present.
    Quote Quote  
  11. I agree it's time to move to something else less limiting

    But you don't specifically need to save an alpha channel . Another method it's commonly done is with a luma matte as a separate video , that is composited with the original video (white = areas of transparency, black = 100% opaque, grey = intermediate "shades" of transparency) . (But it might be MEP doesn't support this type of compositing)

    Or you can use some free methods of keying e.g. cinegobs keyer, blender (bit of a learning curve, but very powerful), I think maybe even wax can do this (key and export with alpha)
    Quote Quote  
  12. Thanks all.

    It's a love/hate relationship with MEP but overall the former wins out and I'll be sticking with it, albeit supplemented by other stuff. I still occasionally dust off MemoriesOnTV for a few effects I can't do in MEP, plus Bluff Titler when I fancy some spectacular text. And various other tools, to which I'll now consider adding those you mention.

    That technique you describe also sounds very interesting. I may be back for some help when I try it.

    --
    Terry, East Grinstead, UK
    Quote Quote  
  13. For retail clips, the 1st method with embedded alpha is usually the most common, but some places like artbeats sell clips often using the 2nd method (luma matte)
    Quote Quote  
  14. heheh. I just noticed the hour hand moves 1.5 hours each time the minute hand goes around!

    By the way, VirtualDub can export a GIF with alpha channel after opening an ARGB source.
    Image Attached Images  
    Last edited by jagabo; 4th Jul 2013 at 16:17.
    Quote Quote  
  15. My immediate task now is illustrated below:

    Click image for larger version

Name:	MEP-ClockBeforeKeying.jpg
Views:	356
Size:	149.4 KB
ID:	18703


    Click image for larger version

Name:	MEP-ClockAfterKeying.jpg
Views:	287
Size:	225.0 KB
ID:	18704


    Click image for larger version

Name:	MEP-Clock-Alternatives.jpg
Views:	325
Size:	239.5 KB
ID:	18705

    Any help would be very welcome please.

    --
    Terry, East Grinstead, UK
    Quote Quote  
  16. Originally Posted by jagabo View Post
    heheh. I just noticed the hour hand moves 1.5 hours each time the minute hand goes around!
    Well spotted!

    By the way, VirtualDub can export a GIF with alpha channel after opening an ARGB source.
    I'll look up ARGB shortly...

    --
    Terry, East Grinstead, UK
    Quote Quote  
  17. yes, color keying won't work well if both the wanted and unwanted areas contain the same characteristics (in this case, the color black)

    e.g. if an actor wears a green shirt to a green screen keying session , the shirt will become transparent as well

    for this "immediate task", you don't even need a color key; just draw a circular mask over the clock because you want to keep the yellow clock face in this case (can you do that in MEP) ?
    Quote Quote  
  18. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    find a clock on a white background with a white face. then both will be keyed. like.
    Click image for larger version

Name:	snapshot_00.13_[2013.07.04_18.09.16].jpg
Views:	21816
Size:	17.2 KB
ID:	18706
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  19. Originally Posted by poisondeathray View Post

    for this "immediate task", you don't even need a color key; just draw a circular mask over the clock because you want to keep the yellow clock face in this case (can you do that in MEP) ?
    Thanks, that's the approach I first tried but it failed. Because the mask (an appropriately sized white circle on a black background), while allowing the clock to be seen, then hides most of track 1. Am I making some embarrasingly simple mistake here?

    With a still image I could use alpha to solve the problem...


    Terry, East Grinstead, UK
    Quote Quote  
  20. Originally Posted by aedipuss View Post
    find a clock on a white background with a white face. then both will be keyed. like.
    Thanks. I did find several like that (maybe that specific one?) but i think they they were $50 to $100, not free like my two examples.

    Terry, East Grinstead, UK
    Quote Quote  
  21. Originally Posted by terrypin View Post
    Originally Posted by poisondeathray View Post

    for this "immediate task", you don't even need a color key; just draw a circular mask over the clock because you want to keep the yellow clock face in this case (can you do that in MEP) ?
    Thanks, that's the approach I first tried but it failed. Because the mask (an appropriately sized white circle on a black background), while allowing the clock to be seen, then hides most of track 1. Am I making some embarrasingly simple mistake here?

    With a still image I could use alpha to solve the problem...


    Terry, East Grinstead, UK
    Not sure how MEP works, but a white circle on black background is a luma matte ; it involves 2 tracks (ie. 2 layers, the clock layer and the matte layer)

    A mask is usually drawn on the layer itself (1 track)

    Either method should work.

    If it's too big you just scale the layer down to whatever size you want
    Quote Quote  
  22. Originally Posted by terrypin View Post
    Originally Posted by poisondeathray View Post
    for this "immediate task", you don't even need a color key; just draw a circular mask over the clock because you want to keep the yellow clock face in this case (can you do that in MEP) ?
    Thanks, that's the approach I first tried but it failed. Because the mask (an appropriately sized white circle on a black background), while allowing the clock to be seen, then hides most of track 1. Am I making some embarrasingly simple mistake here?
    This is what you want?

    clock:
    Click image for larger version

Name:	clock.png
Views:	5762
Size:	68.7 KB
ID:	18711

    mask:
    Click image for larger version

Name:	mask.png
Views:	5899
Size:	5.7 KB
ID:	18712

    Background+(Clock+Mask)
    Click image for larger version

Name:	overlay.png
Views:	5220
Size:	70.6 KB
ID:	18713

    Is the problem just that the clock is too big for your frame size? Can't you just resize and reposition it on the fly?
    Last edited by jagabo; 5th Jul 2013 at 07:22.
    Quote Quote  
  23. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    In order to do compositing work, you need to be able to parent/child tracks(layers), and define composite operators like ADD, SUBTRACT, MASK, DODGE, BURN, etc. This is what delineates Vegas Pro from the Studio line too. When you buy into a software line, you don't know what you don't know. So it's important to choose wisely.

    But don't feel bad, Apple's Final Cut Pro managed to worm it's way into Hollywood as a "Pro" NLE, and later discontinued and de-throned because it sucks, but it was endorsed by Walter Murch, who is considered Hollywood's master editor.

    There are many different sub-disciplines in editing, and it's not uncommon that even professionals that work in broadcast or film are only aware of their own slice of the editing pie, yet newbies will assign a high value to their opinion. This is how Apple used Walter Murch as a shill to form a coup against Avid.

    Some company's business model is like the "Dummies" series of books. They cater to the bottom third. But unlike the "Dummies" series, Apple charges a premium price. At least Magix is reasonable.

    Anyway, I'm not going to bash Apple , but I recommend you switch to Vegas Studio, the cheapest version, and re-learn the interface, now while you're still getting started. The longer you wait, the more painful the switch.

    Also, some of the people here are quite proficient with the free script-based softwares, and can accomplish amazing things, but they also have years of experience behind them. Nowadays, you can't spend years learning something because progress is much faster now, and you don't want to fill your mind with scripting. You want to free your mind to think in creative ways.
    Last edited by budwzr; 5th Jul 2013 at 08:55.
    Quote Quote  
  24. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Originally Posted by aedipuss View Post
    find a clock on a white background with a white face. then both will be keyed. like.
    But your example doesn't have the attributes you describe. The face is not white.
    Quote Quote  
  25. For the other clock - What is this "black, stamp, mix ?" - are those the "modes" for the chroma key in MEP?

    What's wrong with the one on the right (mix?) in the preview ? Or did you mean you wanted a black clock face (not transparent) ?

    The one on the left has color fringing (bad key)
    Quote Quote  
  26. Thanks for the follow ups. Will get back on the case tomorrow.

    @poisondeathray


    Yes, those are the modes. As per top right section of first of my two recent screenshots. An extract from the PDF manual below.

    Yes, I thought the most readable across varying backgrounds would be the white on black.

    Chroma key
    ==========

    This section contains the effects for chroma keying used to mix together two videos
    into a foreground and background.
    Note: The background video must be placed in the track above the foreground
    object. E. G.: Track 1: Background, Track 2: Foreground

    Mode
    ----

    Stamp: The currently selected object is "stamped" onto the video on the track above
    the object. This is only possible if the bottom video takes up only a part of the image.
    Otherwise only the bottom (currently selected) video would be visible. Normally, the
    object should be reduced or moved first. This is done with the help of "Position/size"
    (view page 119) effect or via the submenu "Section" in "Effects -> Video object
    effects".

    Color: In the preview monitor, drag the cursor over the color that should be
    transparent and select a section. The video is made transparent in the sections with
    this color and the video on the top track will show “through”.

    Mix: This button mixes the two videos together based on the brightness. Brighter
    areas accumulate and quickly appear white; darker areas have less of an effect on the
    result.

    Colors to be hidden

    Green/blue/black/white: All green/blue/black/white areas of the video below
    appear transparent. This makes it possible to "place" a person who has been recorded
    in front of a blue background into any type of landscape.
    Water: Only the contours of the upper video are mixed, which results in something
    like a water effect..

    Alpha: This video effect uses the brightness of a video to control a transition effect
    between two other videos on neighboring tracks. The additional videos should be
    situated directly above and below the alpha-keying object.
    In all black parts of the alpha-keying object, the top video is faded in, while in all white
    passages the bottom video is shown. Grey passages are permeable for both videos
    and create a mixture of the two. In the case of colored passages, the brightness of the
    color is used for control purposes.
    You can use the "Threshold value", "Transition area" and "Antispill" controls to fine-
    tune your results, e. g. to remove reflections of hidden colors on surfaces or to
    sharpen the transitions to objects.

    --
    Terry, East Grinstead, UK
    Quote Quote  
  27. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    While you're waiting for PDR, here's an example of some of the modes in industry standard terminology. Magix is using it's own vernacular so you get confused if you change software. Or else their tools have limited or different capability.

    Quote Quote  
  28. And I think MEP is complicated!

    MAGIX plainly covers just a small subset of those. And I wouldn't be confident about mapping its 4 against those 14.

    For Hollywood movies I suppose all of this versatility is a must. But for my family holiday DVDs...

    Terry, East Grinstead, UK
    Last edited by terrypin; 5th Jul 2013 at 16:08.
    Quote Quote  
  29. So did you get it figured out, or are you still stuck ?
    Quote Quote  
  30. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Originally Posted by jagabo View Post
    heheh. I just noticed the hour hand moves 1.5 hours each time the minute hand goes around!

    By the way, VirtualDub can export a GIF with alpha channel after opening an ARGB source.


    Actually, that's quite impressive.
    Quote Quote  



Similar Threads