Questions tagged [avcomposition]

72 questions
2
votes
1 answer

Creating AVComposition with a Blurry Background in iOS

I'm not really sure how to go about asking this question, I would appreciate any helpful feedback on improving this question. I am trying to make a function that accepts a video URL as input (local video), in turn this function tries to create a…
Alan S
  • 594
  • 3
  • 13
2
votes
1 answer

How do i pause video recording with iPhone SDK?

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…
Scoota P
  • 2,622
  • 7
  • 29
  • 45
2
votes
1 answer

Flip video horizontally if so it does not have mirror effect

In my custom camera, when I film a video with the front facing camera, it does the mirror effect like the original iPhone camera. I don't want that. I would like to flip the video horizontally, and implement that in this function down below. I have…
vApp
  • 249
  • 1
  • 6
  • 18
2
votes
1 answer

How to avoid Airplay to freeze when using AVComposition?

My code is as follows: //init mix composition let mixComposition = AVMutableComposition() //video asset let videoAsset = AVURLAsset(url: VIDEO_URL) let videoTrack = mixComposition.addMutableTrack(withMediaType: AVMediaTypeVideo, preferredTrackID:…
Mark
  • 16,906
  • 20
  • 84
  • 117
2
votes
0 answers

Correct TimeMapping of AVComposition

I have an AVComposition with multiple segments and variable speed, I want to get the proper CMTime of a position of the video. If I do: CMTime time = CMTimeMake(duration.value * position, duration.timescale); The time is not proper as the…
MindTrip
  • 283
  • 6
  • 12
2
votes
2 answers

AVAssetExportSession - Join 2 mp4 files in IOS

I am trying to join 2 preexisting mpeg4 video's together on an ipad2 with the following code. -(void)mergeTestVideos { //setup asset NSString *firstassetpath = [NSString stringWithFormat:@"%@mpeg4-1.mp4", NSTemporaryDirectory()]; …
Jamesla
  • 1,378
  • 7
  • 31
  • 62
2
votes
0 answers

Misaligned Sound Playback using AVPlayer and AVMutableComposition

I'm trying to create a song from multiple instrument samples using AVComposition. When I play two sound assets at kCMTimeZero in an AVMutableComposition, I would expect them to play at the same time, but there is a very slight offset. This only…
laverick
  • 714
  • 1
  • 7
  • 23
1
vote
0 answers

AVComposition track transparency

I'm trying to make animated transition with transparent (HEVC with alpha) video such that when transitioning from video1 to video2 the animation video segment is overlaid but transparent to see parts of video1/video2 below the animation. Here's the…
manikal
  • 953
  • 7
  • 30
1
vote
1 answer

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

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 =…
Mikael
  • 3,572
  • 1
  • 30
  • 43
1
vote
0 answers

How to combine AVVideoCompositions for different AVCompositions into one

I have multiple AVAsset videos that I string together using timeRanges in an AVComposition. Each video has an associated AVVideoComposition that uses the animationTool to add an overlay layer to the video. I want to be able to string these…
Tometoyou
  • 7,792
  • 12
  • 62
  • 108
1
vote
0 answers

Inserting slowMo AVComposition into AVMutableComposition

PHPhotoLibrary gives an AVComposition rather than an AVURLAsset for a video recorded in SlowMo. I want to insert slowMo videos into another AVMutableComposition, so this means I need to insert this AVComposition into AVMutableComposition which is my…
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131
1
vote
1 answer

`AVMutableCompositionTrack.insertTimeRange` fails with error -11800

I'm creating AVMutableComposition from video and audio tracks: func makeComposition(videoTrack: AVAssetTrack, audioTrack: AVAssetTrack) -> AVComposition { let composition = AVMutableComposition() /* ... */ let compositionAudioTrack =…
Alexander Vasenin
  • 11,437
  • 4
  • 42
  • 70
1
vote
0 answers

Why AV Export session exports black video if AVAsset contains time-lapse video? How To resolve the issue?

I have created a function which generates avcompostion according to AVAsset duration and content. If the video is slow-mo or regular it works completely fine but when videoType is time-lapse it shows black screen after exporting. If I played…
1
vote
0 answers

How increase video speed into iOS without change video FPS?

I made a video with 30FPS and 18s. I want increase x3 the video speed and get a new video with 6s (18s/3). I did the resolution bellow: let newDuration = CMTimeMultiplyByFloat64(asset.duration,…
1
vote
2 answers

AVPlayer resizeAspect works only properly on iPhone X

resizeAspect as the video gravity only works properly for me, when using an iPhone X. For some reasons, the black aspect bar gets only added to the top and not to the bottom. This is how it looks like when I'm not using an iPhone X (the image is…
thelearner
  • 1,440
  • 3
  • 27
  • 58