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
+ Reply to Thread
Results 1 to 30 of 114
-
-
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 -
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)
I didn't bother to clean out the red text overlay at the bottom of the clock. -
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 -
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.
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
--
Terry, East Grinstead, UK -
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" -
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)
Last edited by jagabo; 4th Jul 2013 at 11:55.
-
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 -
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 -
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) -
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 -
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)
-
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.Last edited by jagabo; 4th Jul 2013 at 16:17.
-
-
Well spotted!
By the way, VirtualDub can export a GIF with alpha channel after opening an ARGB source.
--
Terry, East Grinstead, UK -
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) ? -
--
"a lot of people are better dead" - prisoner KSC2-303 -
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 -
Last edited by jagabo; 5th Jul 2013 at 07:22.
-
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.
-
-
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) -
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 -
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.
-
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, UKLast edited by terrypin; 5th Jul 2013 at 16:08.
Similar Threads
-
AVIsynth -- how do I add an audio wav to a video only clip.. [SOLVED]
By vhelp in forum EditingReplies: 7Last Post: 19th Nov 2013, 05:27 -
Avisynth add blank audio to a clip??
By duhmez in forum Video ConversionReplies: 1Last Post: 13th Dec 2012, 03:58 -
How to convert .mov (with alpha video 32bits) into .flv with transparency ?
By akinnzip in forum Video ConversionReplies: 1Last Post: 8th Jun 2011, 09:41 -
any free tools to resize/clip mpg2 and add black borders?
By extent in forum EditingReplies: 4Last Post: 16th Dec 2009, 17:23 -
Ulead Video Studio 11 - how to add multiple sub and more movie clip
By mic2x in forum SubtitleReplies: 0Last Post: 27th Aug 2008, 12:52