Questions tagged [avfoundation]

The AVFoundation framework provides both Objective-C and Swift interfaces for editing and playing audio-visual media in a Mac OSX or iOS application. Questions using this framework should include this tag.

6407 questions
3
votes
1 answer

Trouble applying scaleTimeRange on multiple videos in a AVMutableComposition video

I am attempting to merge videos with scaleTimeRanges (to make them slo-mo or speed-up); however, it is not working as desired. Only the first video has the timerange effect... not all of them. The work is done in the merge videos function; it is…
NCT 127
  • 596
  • 1
  • 6
  • 27
3
votes
0 answers

SWIFT - How to make video background transparent while saving the video?

Hi I want to save a video which I have made from editing a video - like adding filter and sticker and then retreiving all the frames as snapshots and making the photos merge into a video. My snapshots have clear background color. But when the video…
3
votes
3 answers

Can I get PHAsset / AVAsset is hdr video/dolby vision on iphone12?

I want to add HDR icon to indicate some asset is HDR, but I can't get any info to check a video if this is a HDR video record from iphone12
jft0m
  • 193
  • 1
  • 7
3
votes
1 answer

Append buffers to an AVAssetWriterInputPixelBufferAdaptor *not* chronologically?

I'm appending CVPixelBufferRefs to an AVAssetWriterInputPixelBufferAdaptor which is connected to an AVAssetWriterInput to write to a file using AVAssetWriter. So, I'm calling [pixelAdaptor appendPixelBuffer:pxbuffer…
m.gansrigler
  • 185
  • 2
  • 9
3
votes
1 answer

Merging *.mp3 with *.mov file using AVAssetReader and AVAssetWriter

I was able to create a *.mov file using the AVAssetWriter. I used screenshot images and audio CMSampleBuffer i got from using AVCaptureSession and passed it to the inputs for the AVAssetWriter and it worked. Now I would like to merge the *.mov file…
calampunay
  • 108
  • 1
  • 8
3
votes
1 answer

iPhone song lyrics access

I'm trying to get the lyrics for a song on an iOS device and the examples I've found on the web and stackoverflow show getting the song's MPMediaItem (i.e. using a [MPMediaQuery songsQuery] with MPMediaItemPropertyPersistentID as a predicate) and…
Jer
  • 344
  • 3
  • 12
3
votes
0 answers

How to control AVPlayer buffering

I'm using an AVPlayer to play a remote progressive download (i.e. non-HLS) video. But, I can't figure out how to control its buffering behavior. I would like to pre-fetch 2 seconds of the video before it's ready to play, and also to stop buffering…
New Dev
  • 48,427
  • 12
  • 87
  • 129
3
votes
1 answer

Taking high resolution photo from captureStillImageAsynchronouslyFromConnection

Currently captureStillImageAsynchronouslyFromConnection returns an image at 640x480 pixels from a AVCaptureSession of AVCaptureSessionPreset640x480. The reason for a relative low-res AVCaptureSessionPreset640x480 is I need to process the video…
ohho
  • 50,879
  • 75
  • 256
  • 383
3
votes
3 answers

iPhone App - Show AVFoundation video on landscape mode

I am using the AVCam example App from Apple. This example uses AVFoundation in order to show video on a view. I am trying to make from the AVCam a landscape App with no luck. When screen orientation changes the video is shown rotated on the view. Is…
bashan
  • 3,572
  • 6
  • 41
  • 58
3
votes
2 answers

AVCapturePhotoCaptureDelegate methods aren't being called every time

I'm building a custom camera, and I'm having flakey results. When I attempt to capture an image, I'm sometimes not receiving the expected delegate callbacks. For example, here are my delegate methods: func photoOutput(_ output: AVCapturePhotoOutput,…
Kelvin Lau
  • 6,373
  • 6
  • 34
  • 57
3
votes
1 answer

How to compare AVCaptureDevice.DeviceType to understand which one is the best option?

AVCaptureDevice.DeviceType has a set of camera options and allows us to list available devices and pick one of them. For example, the code block below lists available devices on my iPhone. let discoverySession =…
amone
  • 3,712
  • 10
  • 36
  • 53
3
votes
1 answer

Decoding frames with VTDecompressionSessionDecodeFrame fails with 12909 error

I'm trying to decode CMSampleBuffer so I can analyze their pixel data. I keep getting error 12909 when I call VTDecompressionSessionDecodeFrame. This is all very new to me - any ideas where might be the problem? Here's my code: func…
msmialko
  • 1,439
  • 2
  • 20
  • 35
3
votes
0 answers

Is there a way to write custom metadata to individual video frames with AVFoundation?

I am recording video within my iOS app, and I need to write a small amount of metadata to some of the video frames as they get recorded. Is there a way to do this? I currently have my AVCaptureVideoDataOutput and…
Alan Scarpa
  • 3,352
  • 4
  • 26
  • 48
3
votes
0 answers

AVAudioSession setPreferredSampleRate not working on iPhone 11 and above

I have a legacy video streaming library that seems to be broken on iPhone 11 (and above) devices. After digging into the problem it seems that the code that is initiating the AVAudioSession is failing due to the call to…
Lucas P.
  • 4,282
  • 4
  • 29
  • 50
3
votes
1 answer

Default AVCaptureDevice for front position is too "wide" on iPhone 11

Default Camera.app on iPhone 11 acts a little bit different when it comes to selfie camera. It now has a "zoom out" button, which kind of acts as switching to ultra-wide camera. Image below demonstrates the difference between zoom modes. In my…
xinatanil
  • 1,085
  • 2
  • 13
  • 23
1 2 3
99
100