-
Notifications
You must be signed in to change notification settings - Fork 226
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
Comments
Fixed on 61c64d3 You may try it out, I'm a lot busy recently, reply maybe not very timely |
Hi Vito, |
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. |
Hi Vito,
Thank you for your reply, I guess that what you mean is that if we are extracting the frames from the videos each frame will be opaque, and that you couldn't find a way to extract frames that contain transparency with Apple API correct?
The strange thing about this is that if I use:
let overlay = composition.addMutableTrack(withMediaType: .video, preferredTrackID: Int32(kCMPersistentTrackID_Invalid))
and then:
let instruction = videoCompositionInstructionFor(track: overlay!, using: overlayAsset) mainInstruction.layerInstructions.insert(instruction, at: 0)
I am able to overlay a transparent video. The question is, can the framework easily support this by bypassing the need to extract frames if I decide not to apply filters or other actions that require frame manipulation?
GIF and APNG files are very big, slow and memory consuming formats that I would like to avoid, if you find it hard to bypass the frame manipulation I think that my workaround will be to save the results from Cabbage, import the results as Avasset and then use the core API to add the overlay and then save again.
Will be more than happy to hear your thoughts.
P.S: The workaround worked nicely
|
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.
The text was updated successfully, but these errors were encountered: