Questions tagged [avvideocomposition]

80 questions
2
votes
1 answer

Is it possible to record and save to a file by using jpeg coder with quality setting in iOS?

There basically are 2 encoders that Apple provided, h264 or avc1 and jpeg. let settings:[String:AnyObject] = [ AVVideoCodecKey: AVVideoCodecJPEG, AVVideoWidthKey: 720, AVVideoHeightKey: 1280, AVVideoQualityKey: 0.5 ] //Line below is…
shawhu
  • 1,217
  • 1
  • 12
  • 27
2
votes
1 answer

How to set Background image to AVMutableVideoCompositionInstruction

I set the backgroundColor its Working fine, but i am not able to set the background image. AVMutableVideoCompositionInstruction * mainInstruction = [AVMutableVideoCompositionInstruction videoCompositionInstruction]; mainInstruction.timeRange =…
2
votes
1 answer

Crop Recorded Video Frame

I am trying to crop a video frame. I have recorded the video using AVFoundation framework. I need to crop the snapped image and recorded video into a square shape. I have done it for the UIImage which worked, and now I am trying to crop the video.…
2
votes
1 answer

AVFoundation export video with animation at specific time duration in previously recorded video?

I am using AVAssetExportSession to export video with my animation at specific time. It was running fine before 2 days. Now i changed something and it stopped working i don't know what is wrong with it. Sorry for too long code. Can anyone help me…
2
votes
0 answers

Avplayer not playing video when audio is present in the composition

I have been struggling with a problem where avplayer is not showing the video asset if I add audio to the composition. Here is the code as it is now: - (void)viewDidLoad { [super viewDidLoad]; AVMutableComposition *composition =…
1
vote
1 answer

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 the resulting portrait video isn't centered in…
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
1
vote
0 answers

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 synthesize the video and play it in AVPlayer, only sound…
1
vote
0 answers

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 holds the old filter values for those pre-rendered…
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
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
1 answer

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: kCMPersistentTrackID_Invalid) let soundtrackTrack…
CaptainMishan
  • 27
  • 1
  • 7
1
vote
1 answer

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 thing is when i want to convert the layer to a cg or…
Mostafa
  • 48
  • 1
  • 8
1
vote
1 answer

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 the CIFilter. my code let filter = CIFilter(name:…
Stefano Vet
  • 567
  • 1
  • 7
  • 18
1
vote
0 answers

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 happens when I set the…
1
vote
0 answers

How to show different text over video based on time range using CATextLayer?

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 combined it in video composition. But my problem is I…