avcomposition

Transform wrong when using both AVComposition and AVVideoComposition

非 Y 不嫁゛ 提交于 2021-02-11 07:39:18
问题 I am creating an AVMutableComposition . I need the asset to be flipped horizontally, so I am setting the transform of the composition track like this: compositionTrack.preferredTransform = assetTrack.preferredTransform.scaledBy(x: -1, y: 1) If I export this (I use AVAssetPreset960x640 as my preset), this works as expected. However, I also need to add an AVMutableVideoComposition overlay to be rendered with this copmosition. This overlay shouldn't be flipped horizontally. I specify this like

Transform wrong when using both AVComposition and AVVideoComposition

故事扮演 提交于 2021-02-11 07:38:04
问题 I am creating an AVMutableComposition . I need the asset to be flipped horizontally, so I am setting the transform of the composition track like this: compositionTrack.preferredTransform = assetTrack.preferredTransform.scaledBy(x: -1, y: 1) If I export this (I use AVAssetPreset960x640 as my preset), this works as expected. However, I also need to add an AVMutableVideoComposition overlay to be rendered with this copmosition. This overlay shouldn't be flipped horizontally. I specify this like

How do i pause video recording with iPhone SDK?

笑着哭i 提交于 2020-01-01 07:02:08
问题 I see there is an app called iFile with a pause feature while recording video. How do they do this? I tried using AVMutableComposition classes and when the user pauses i cut a new video and then merge the video at the end, however the processing time to merge the videos is not desirable. Can someone give me other good ideas on how to do this? I noticed the iFile way is very seamless. Thanks 回答1: Here are some ideas. I have not tried either of these. If you are using an AVAssetWriter to write

Audio video merge with main video sound

拟墨画扇 提交于 2019-12-25 09:07:09
问题 I can merge a video with another audio nicely. But I also need main video sound in final output video. That means I want to set main video sound with low volume. How can I do this? -(void)mergeAndSave { //Create AVMutableComposition Object which will hold our multiple AVMutableCompositionTrack or we can say it will hold our video and audio files. AVMutableComposition* mixComposition = [AVMutableComposition composition]; //Now first load your audio file using AVURLAsset. Make sure you give the

Find assets in library - add to a AVMutableComposition - export = crash

拜拜、爱过 提交于 2019-12-23 04:06:06
问题 I've been struggling with adding assets from the iPhone Photo Library to a AVMutableComposition and then export them. Here is what I got: Finding the assets: (here I grab the AVURLAsset) -(void) findAssets { ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; // Enumerate just the photos and videos group by using ALAssetsGroupSavedPhotos. [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) { // Within the group enumeration block,

How to set a transparent background for an AVVideoComposition?

帅比萌擦擦* 提交于 2019-12-21 05:14:14
问题 Update - I've added a 50 reputation bounty for answering this question! I have an application that needs to put together some videos and photos to create a movie out of them. I am using AVMutableComposition for that. To be able to instruct it how the videos get composed I have to use an AVMutableVideoComposition. This thing has a property called backgroundColor and Apple Documentation says: Only solid BGRA colors are supported; patterns and other supported colors are ignored. If the rendered

Compositing 2 videos on top of each other with alpha

不羁岁月 提交于 2019-12-20 09:25:36
问题 AVFoundation allows you to "compose" 2 assets (2 videos) as 2 "tracks", just like in Final Cut Pro, for example. The theory says I can have 2 videos on top of each other, with alpha, and see both. Either I'm doing something wrong, or there's a bug somewhere, because the following test code, although a bit messy, clearly states I should see 2 videos, and I only see one, as seen here: http://lockerz.com/s/172403384 -- the "blue" square is IMG_1388.m4v For whatever reason, IMG_1383.MOV is never

Multiple videos with AVPlayer

假如想象 提交于 2019-12-18 09:56:06
问题 I am developing an iOS app for iPad that needs to play videos in some part of the screen. I have several video files that needs to be played after each other in an order that is not given at compile time. It must looks as if it is just one video playing. It is fine that when going from one video to the next that is some delay where the last or first frame of the two videos are shown, but there should be no flickering or white screens with no content. The videos does not contain audio. It is