Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay H.265 Video with Transparency #72

Open
BoazTelem opened this issue May 19, 2021 · 4 comments
Open

Overlay H.265 Video with Transparency #72

BoazTelem opened this issue May 19, 2021 · 4 comments

Comments

@BoazTelem
Copy link

BoazTelem commented May 19, 2021

Hi Guys!

I am trying to add a transparent H.265 video as an overlay and I am getting an opaque background for this track.
I tried to set the timeline background to transparent:

timeline.backgroundColor = CIColor(red: 0, green: 0, blue: 0, alpha: 0)

But it did not work. Any idea how to set the background layer of an overlay to be transparent?

I am creating a video track item and add it to the overlay array using:

timeline.overlays = [overlayTrackItem]

P.S:
When using the native AVMutableComposition and using the addMutableTrack the transparency is working just fine. I will be more than happy to learn how to eliminate the track background in Cabbage.

@vitoziv
Copy link
Contributor

vitoziv commented May 24, 2021

Fixed on 61c64d3

You may try it out, I'm a lot busy recently, reply maybe not very timely

@BoazTelem
Copy link
Author

Hi Vito,
Thank you for investing the time looking into it! Unfortunatly it is still opaque, I have emailed you a transparent overlay should you wish to quickly see the results. Hopefully we can resolve this bug soon as transparent video overlays are simply amazing feature for this great framework.

@vitoziv
Copy link
Contributor

vitoziv commented May 25, 2021

Hi

I think it's not possible to use a transparent video, video files only contain YUV data, we can't get the alpha value from YUV data.
You may change your transparent video to a GIF or PNG list or something like this.
You can subclass a ImageResource and implement your custom imageResource

@BoazTelem
Copy link
Author

BoazTelem commented May 25, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants