Rounded, transparent corners

Flyarbo wrote on 2/23/2012, 12:19 PM
I have a video I use on a web site and it has an odd aspect ratio: 950 wide by 310 high. I'd like it to have rounded, transparent corners such that the background of the website shows through at the corners

I can do this in Photoshop in a separate post process, but that means another render, which takes forever.

I've tried importing a PNG file to act as a mask, and I get rounded corners OK, but they have black in the corners, not transparency.

How do I do this in Vegas, either using a PNG file on the top layer as a mask or simply in Vegas by itself?

Thanks all.

S.

Comments

amendegw wrote on 2/23/2012, 12:47 PM
What video player are you using? Flash? I know of no way to do this in Flash except to "fake it out" by making your background color the same as the background of your web page. There may be other ways to do it. Maybe some flash experts can dial in.

However, if your browser supports HTML5 & CSS3, you can use the "border-radius" property with the <video> tag to display the video. See: Border-radius: create rounded corners with CSS

See: HTML5 Test

Of course, you won't see the rounded corners if your browser doesn't support them.

...Jerry

Edit: Just did some testing - works in IE9 & Firefox, but not in Chrome.

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

Flyarbo wrote on 2/23/2012, 12:59 PM
No, I don't use flash. All HTML 5.

As I say, I can, and do, do this now using the video editing features in Photoshop CS 5.5 (and earlier). Just mask as normal and PS renders a video with transparency in the corners just as it would in, say, a PNG file. PS is smart that way. The video shows nice and rounded and transparent in all the corners and my complex web page background shows thru all nicey nicey.

But this makes each video edit a 3 render job: 1 for the base vid, 1 in PS for the rounded, transparent corners, and a collection of others in a post process to support HTML5 (MP4, WebM, and blah blah outputs).

I'd like to remove the PS step. If PS can render a vid with transparent corners, I'm pretty sure VP can do it too. I'm just too dumb to know how at the moment.

S.
amendegw wrote on 2/23/2012, 1:10 PM
I guess, I was incomplete in my reply. The video above was rendered with square corners (i.e. without photoshop masking). The rounding occurred entirely in the html. Here 'tis:

    <div style="width: 1024px; margin: 0 auto; background: url(Images/html5.gif) repeat;
text-align: center; padding-bottom: 50px; -moz-border-radius: 15px; border-radius: 15px;">
<h1 style="text-align: center">
HTML5 Testing</ h1>
<video style="-moz-border-radius: 8px; border-radius: 8px;" width="640" height="360" autoplay controls>
<source src="Videos/Horse.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<source src="Videos/Horse-FF.ogv" type='video/ogg; codecs="theora, vorbis"' />
<source src="Videos/Horse.webm" type='video/webm; codecs="vp8, vorbis"' />
</video>
</div>


...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

Flyarbo wrote on 2/23/2012, 1:37 PM
Jerry:

I see what you're saying, and the idea is great; a simple and reasonable and nicely tailor-able solution. But...it doesn't work in Chrome, which is my main browser. (Interestingly, it DOES work in Chrome...for just a moment. And then it goes square-cornered. Would have been a GREAT solution, too.).

So...I'm kinda back where I started.

Anything else?

S.
amendegw wrote on 2/23/2012, 2:31 PM
Bummer! I just spent about a half hour doing some Google research and it appears others are equally stumped here: http://stackoverflow.com/questions/6238451/rounded-corners-on-html5-video

I thought maybe this might be solved using jQuery, but couldn't readily come up with a solution. Plus jQuery is not my strong suit.

...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

Flyarbo wrote on 2/23/2012, 3:05 PM
Is there, perhaps, any answer that lies within VP itself? Masking or child layers or some such?

Anyone?
amendegw wrote on 2/23/2012, 4:06 PM
This seems to work: http://www.jazzythedog.com/testing/monkey.html

Same trick as with Flash - create a .png mask with a transparent center and outside border the same color as the webpage background. In this case #FFFF6F.



Somewhat kludgy... there may be better solutions.

....Jerry

btw: The above link doesn't work in Firefox as I only rendered to .mp4 video format.
btw2: Don't forget the levels expansion when playing h.264 videos

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

Flyarbo wrote on 2/23/2012, 5:05 PM
That's what I hate about anything having to do with working with the Internet. Eventually, it always comes down to some unclean thing involving goats blood and heinous acts at midnight by a full moon.

Thanks fer trying'.

S.
amendegw wrote on 2/23/2012, 5:31 PM
"Eventually, it always comes down to some unclean thing involving goats blood and heinous acts at midnight by a full moon.Ha! I guess my statement "Somewhat kludgy" was the understatement of the day!! [grin]

...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

rmack350 wrote on 2/23/2012, 11:09 PM
First off, I haven't tried this, but here are some things I'd be looking for:

--Does the codec you're rendering to actually support an alpha channel?
-----Is there a setting for this in the Render settings dialog?
--Is there a specific matte mode, like premultiplied, that you need to pay attention to?
--We know Flash can play video with alpha. I think that's with the VP6 codec and not h.264. Although you don't want to use Flash, there might still be some clues online.

And although the HTML5 corners route isn't working in Chrome, since you say it works for a second, there must be a solution.

<edit> When I right click the video in firefox and chose "Save video as..." it offers to save the .ogv version. In Chrome it offers to save the .mp4 version. So the two browsers are playing two different files. Maybe that affects whether the corners work.

btw, you can get a lot of information out of Chrome, IE, and Firefox by opening the Developer Tools windowpane (or equivalent). You might need to add it in to Firefox but Chrome and IE include it.</edit>

Rory Cooper wrote on 2/24/2012, 6:40 AM
You have done everything correctly in your setup and mask. The problem may be in your render or stipulate alpha on import.

Check project settings 32bit not 8bit older Vegas rendered alpha at 8bit ok not recent updates.
Did you right click mask and select straight on alpha if tiff it could be straight or multiplied depending on your output in Photoshop.

Even so if all else fails simply add mask gen fx = luminance to mask and it will still be ok.