79
questions
0
votes
1
answer
143
views
How to display a cutout/portion of a video in AVFoundation
I'm trying to crop a video / display a portion of a video in AVFoundation. So far my code looks right to me but the output is not what I wanted. I don't see what is wrong. Any ideas?
let item = ...
0
votes
0
answers
255
views
Swift: Apply CIFilter to video error - unfinished AVAsynchronousVideoCompositionRequest deallocated
I'm building a video editor that lets you apply a CIFilter to a video. And it works well.
The only problem I'm facing is that when I dismiss the ViewController I get this error:
Unfinished ...
0
votes
1
answer
473
views
CIImage CVPixelBuffer is nil after scaling down
I'm using the AVVideoComposition API to get CIImages from a local video, and after scaling down the CIImage I'm getting nil when trying to get the CVPixelBuffer.
Before scaling down the source frame, ...
2
votes
1
answer
293
views
CGAffineTransform -How to Align Video in Screen Center
I've been able to center the middle of a 16:9 landscape video, crop the video, and then create a 9:16 portrait version of the video similar to how Apple does it in the Photos album.
The only issue is ...
1
vote
0
answers
405
views
Play video synthesized by AVMutableComposition in AVPlayer with error
I am creating an IOS video editing tool by AVMutableComposition.
If I combine multiple videos in a single video mutabletrack, it works fine. However, when I create mutabletrack per video and ...
1
vote
0
answers
127
views
How can I stop AVVideoComposition from pre-rendering frames?
I have a custom compositor that renders frames while applying filters. When I change the filters properties with a slider, the change is delayed since the video composition renders ahead of time and ...
1
vote
0
answers
170
views
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 ...
0
votes
1
answer
461
views
AVAsynchronousVideoCompositionRequest sourceFrameByTrackID nil for video with alpha
I'm trying to add some transparent animation videos to my composition as a transition but in my custom compositor (AVVideoCompositing) when I try to get pixel buffer via
...
2
votes
0
answers
320
views
AVPlayerItemVideoOutput stops delivering frames after seek with video composition
I want to play a video and process it using Core Image filters. I have the following setup:
the video as an AVAsset
an AVPlayer for controlling the video playback
the AVAsset is passed via ...
1
vote
0
answers
367
views
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 ...
1
vote
1
answer
220
views
Exporting AVAsset second time makes video blank
I am stitching multiple video files into one using AVMutableComposition() adding tracks like this:
let compositionVideoTrack = mainComposition.addMutableTrack(withMediaType: .video, preferredTrackID: ...
2
votes
0
answers
175
views
Creating slideshow using Core Image and AVFoundation
I have a number of images that would be shown in a slideshow and each image is displayed for 1 second or more using AVPlayer. I used the following technique before (around iOS 6 time) that I would ...
1
vote
1
answer
578
views
how to convert UIBezierpath with shadow to UIImage without losing the shadow saturation
I'm doing a drawing app, which allows users to draw on video frames, so when drawing on the UIImageView, i add the Bezierpath to a CAShapeLayer and set a shadow path to it, and it works great, the ...
0
votes
1
answer
368
views
Getting black screen during image compose with custom compositor
I'm trying to make movie from still image, for that i use custom compositor with custom instructions. Actually i get movie and length is as expected, but after one frame (5 second) i get black screen(...
2
votes
2
answers
489
views
CATextLayer on video pixelated text
I am creating video from images and adding overlay to them. Problem is when I try to add CATextLayer to video. Text is pixelated, take a look at the image
This is the code used to generate ...
1
vote
1
answer
105
views
Equal-Power Crossfade in AVMutableVideoCompositionLayerInstruction
How can I get an equal-power crossfade working in an AVVideoComposition? I'm using something like the following to fade between video tracks, but when looping the same video over and over there is a ...
1
vote
1
answer
954
views
switch CIFilters to video
can someone help me to understand the correct way to switch CIFilters without restart video player?
I have a local video playing inside a view. If I tap a cell in collection view, video will change ...
0
votes
1
answer
376
views
VideoComposition not honoring instructions
Since updating to iOS 13 my video composition I use to fade a video in and out is broken. This is my code which worked correctly up until installing iOS 13.
Now when I export the video there is ...
0
votes
1
answer
892
views
Overlaying image on video reduces video resolution
When I overlay an image on my video, the video quality is greatly reduced. If I don't set the video composition of the export session or set the export quality to passthrough, the video quality is ...
2
votes
0
answers
1k
views
AVAssetExportSession is greatly reducing video quality
I have a local video url that I am trying to put an overlay on. It all works properly, but the quality of the video is being drastically reduced upon export.
I have narrowed it down to find that it ...
1
vote
0
answers
273
views
How to show different text over video based on time range using CATextLayer? [duplicate]
I'm working on a video app, that requires displaying text over video for a certain range of time, I need to display different text for different time ranges.
I've already created a text layer and ...
3
votes
1
answer
742
views
Memory Crash Issue with Create Video From array of UImages in Swift
I am working with Video, I create video from array of Uimage. Its works fine with low quantity of images, but with big quantity (ex: 100+ images) it crash because of memory Issue.
I have tested when ...
1
vote
1
answer
2k
views
I want to apply CIFilter on video and save that filter applied video. [export taking too much time]
I want to apply CIFilter on video and save that filter applied video.
I am using AVMutableVideoComposition (also tried with AVVideoComposition) for apply filter on video and its working fine with ...
0
votes
1
answer
578
views
Flip video horizontally on x- axis in objective c
I have two play two videos simultaneously on a view .Both videos would be same.
Now, my concern is the video on right is actually to be flipped horizontally along x-axis and then saved in photo ...
3
votes
0
answers
406
views
iOS Video Filter very slow for AVVideoComposition, CIFilter, CIImage
I want to filter selected video from Photos so use CIFilter and AVVideoComposition but it take too much time.
it take 3 minute for 30 second video.
How to reduce time for filter.
- (void)...
0
votes
1
answer
851
views
AVVideoComposition with CIFilters crash
I am creating an AVVideoComposition with CIFilters this way:
videoComposition = AVMutableVideoComposition(asset: asset, applyingCIFiltersWithHandler: {[weak self] request in
// Clamp ...
10
votes
1
answer
3k
views
Can't show animated CALayer in video using AVVideoCompositionCoreAnimationTool
UPDATE 6:
I've managed to fix my issue completely but I still would like a better explanation than what I'm guessing is the reason it didn't work if I'm incorrect
I've been trying to animate a sprite ...
0
votes
1
answer
628
views
How to trim video of duration more than 30 seconds in iOS?
I want to select video from gallery but user can only choose video upto 30 seconds from the app.
so how to achieve video trimming for certain amount of time?
By using AVFoundation I have done till ...
2
votes
0
answers
333
views
Displaying a filtered video File with a preferredTransform that is not identity swift
For the app I'm working on, I need to provide a functionality that lets users apply filters to their videos( not real time, applying filters on a saved video and filePath is provided).
...
2
votes
0
answers
1k
views
Updating AVPlayerItem video composition
Me and my team are stuck on an issue for a few days now.
We have AVPlayer which plays AVPlayerItem with a custom AVVideoComposition.
player.currentItem?.videoComposition = getUpdatedVideoComisition()...
2
votes
2
answers
2k
views
AVVideoComposition applying filter handler not call
I want to add an overlay image into a video. I use AVVideoComposition and CIFilter to do this, but AVAsynchronousCIImageFilteringRequest handler not called.
I put some breakpoints (line debugPrint"...
3
votes
1
answer
6k
views
Swift: Message from debugger: Terminated due to memory issue
This question is different that in Ios Xcode Message from debugger: Terminated due to memory issue . I am using different device and my app is being killed in foreground, besides that I cannot use ...
2
votes
0
answers
460
views
Video rotation not applying for AVAsset when setting AVAssetExportSession's videoComposition
I simply would like to rotate a video 90 degrees after capturing it. I followed the answer in this thread: iOS how to correctly handle orientation when capturing video using AVAssetWriter
When my ...
1
vote
2
answers
2k
views
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 ...
1
vote
1
answer
1k
views
Adding watermark to video is extremely slow
I am using AVComposition to render a watermark to a video. This process takes around 15 seconds, which doesn't seem ok for a 20 seconds video.
My export settings are:
let exporter = ...
0
votes
1
answer
1k
views
CIImage gets resized when applying to CIFilter
I am trying to add a fullscreen watermark to my video.
Unfortunately, the watermark image (red rectangle) gets resized by the CIFilter and I don't find a way to make it fullscreen.
Is there a way ...
0
votes
0
answers
985
views
AVMutableVideoComposition frameDuration not working
I have a AVMutableVideoComposition and I want to set the export frame rate (e.g. 10 fps):
videoComposition.frameDuration = CMTimeMakeWithSeconds(1, 10);
I've got various other instructions like ...
1
vote
0
answers
445
views
AVVideoComposition doesn't add Text to video - iOS 10.3
I recently posted a question regarding exporting a video with a textOverlay (using AVVideoComposition). I am trying to apply a CATextLayer overlay to a video in swift using the following method :
...
5
votes
1
answer
7k
views
Swift 3 : How to export video with text using AVVideoComposition
I am trying to useAVVideoComposition to add some text on top of a video and save the video.
This is the code I use:
I Create an AVMutableComposition and AVVideoComposition
var mutableComp = ...
9
votes
5
answers
8k
views
Video rotated after applying AVVideoComposition
After applying an AVVideoComposition to my AVPlayerItem, the filter I apply does work, but the video gets rotated in the AVPlayerLayer.
I know for a fact that the problem is not with the filtered ...
1
vote
1
answer
1k
views
IOS video over video merge with circle cropping
Iam making an app which does a basic video processing .
Ive successfully managed to merge to video (video over video) .
how can I crop the up-left small video into a circle ?
2
votes
0
answers
558
views
Cropping a specified CGRect from a video in ios
I want to crop a specified region of CGRect from my video file.
I followed this Tutorial .
I'm using renderSize property of AVMutableVideoComposition to get to a specified size. Here is my code that ...
1
vote
0
answers
1k
views
The performance of AVAssetExportSession(It's too SLOW)
recently, I used AVFoundation framework to add water mark to my video, and then export the new video by AVAssetExportSession. The link below show the method and detail.
https://developer.apple.com/...
5
votes
1
answer
4k
views
AVPlayer plays video composition result incorrectly
I need a simple thing: play a video while rotating and applying CIFilter on it.
First, I create the player item:
AVPlayerItem *item = [AVPlayerItem playerItemWithURL:videoURL];
// DEBUG LOGGING
...
15
votes
4
answers
14k
views
Swift 3: How to add watermark on video ? AVVideoCompositionCoreAnimationTool iOS 10 issue
This code used to work on iOS9 to add a watermark and text to a video but since iOS10 it's not working anymore. There is a iOS 10 bug that has been filed but no answer from Apple. I have not been able ...
20
votes
2
answers
6k
views
Custom AVVideoCompositing class not working as expected
I'm attempting to apply a CIFilter to an AVAsset, and then save it with the filter applied. The way that I am doing this is by using an AVAssetExportSession with videoComposition set to an ...
1
vote
1
answer
175
views
Rendering CALayers with CoreAnimations
How is it possible to render CALayer that has lots of animations to a mov file?
I know how to render it with AVVideoCompositionCoreAnimationTool ...
2
votes
2
answers
1k
views
How do you access the frame number inside AVAsynchronousCIImageFilteringRequest?
When using a CIFilter with an AVVideoComposition, how can I access the current frame number in the AVAsynchronousCIImageFilteringRequest callback?
The best I was able to do is estimate the frame ...
3
votes
0
answers
480
views
transform portrait video to be aspectFit while preview and exporting
I have been trying to get portrait video to transform in a such what that it could be aspect fit in center of player while keep rest of the screen empty.
Example of How the video should look like
...
3
votes
1
answer
2k
views
Resize video and keeping 1:1 scale
I have a 800x800 video and I want to transform this video in 375x375.
It should looks like this:
But the final result is it:
What am I doing wrong?
My Code:
let mixComposition = ...