Questions tagged [avcapturesession]

iPhone - To perform a real-time or offline capture, you instantiate an AVCaptureSession object and add appropriate inputs (such as AVCaptureDeviceInput), and outputs (such as AVCaptureMovieFileOutput).

You use an AVCaptureSession object to coordinate the flow of data from AV input devices to outputs.

To perform a real-time or offline capture, you instantiate an AVCaptureSession object and add appropriate inputs (such as AVCaptureDeviceInput), and outputs (such as AVCaptureMovieFileOutput).

The AVFoundation Programming Guide explains how to use AVCapureSession.

1246 questions
17
votes
4 answers

AVCaptureSession audio doesn't work for long videos

I'm using AVCaptureSession to record a video with audio. Everything seems to work properly for short videos, but for some reason, if I record a video that is longer than about 12 seconds, the audio doesn't work.
eyuelt
  • 1,386
  • 1
  • 15
  • 22
17
votes
2 answers

iOS 8 iPad AVCaptureMovieFileOutput drops / loses / never gets audio track after 13 - 14 seconds of recording

I have the following code which works for iOS 6 & 7.x. In iOS 8.1 I have a strange issue where if you capture a session for about 13 seconds or longer, the resulting AVAsset only has 1 track (video), the audio track is just not there. If you record…
Si-N
  • 1,495
  • 1
  • 13
  • 27
17
votes
4 answers

Video Saving in the wrong orientation AVCaptureSession

I'm trying to record a video (without displaying the camera) and save it. But the video being saved is not saving in the right orientation. I've tried forcing the UIViewController to be a certain orientation but that didn't help. All videos are…
Destiny Dawn
  • 1,457
  • 3
  • 15
  • 29
16
votes
2 answers

AVCaptureSession specify resolution and quality of captured images obj-c iphone app

Hi I want to setup AV capture session to capture images with specific resolution (and, if possible, with specific quality) using iphone camera. here's setupping AV session code // Create and configure a capture session and start it running -…
Oleg
  • 1,383
  • 4
  • 19
  • 35
16
votes
5 answers

Switch front/back camera with AVCaptureSession

I'm following the only answer this has on SO - Switch cameras with avcapturesession However cameraWithPosition does not seem to work. Deprecated? //Get new input AVCaptureDevice *newCamera = nil; …
durazno
  • 559
  • 2
  • 7
  • 25
16
votes
1 answer

Capturing Video with Swift using AVCaptureVideoDataOutput or AVCaptureMovieFileOutput

I need some guidance on how to capture video without having to use an UIImagePicker. The video needs to start and stop on a button click and then this data be saved to the NSDocumentDirectory. I am new to swift so any help will be useful. The…
George Grover
  • 1,134
  • 2
  • 10
  • 17
16
votes
1 answer

Get output from AVCaptureSession in Swift to send to server

I've managed to write some code that opens the camera and previews the video. I now want to capture the frames from the output to send to a server ideally encoded as H.264 Here's what I've got: import UIKit import AVFoundation class ViewController:…
iamjonesy
  • 24,732
  • 40
  • 139
  • 206
16
votes
4 answers

Cropping a captured image exactly to how it looks in AVCaptureVideoPreviewLayer

I have a photo app that is using AV Foundation. I have setup a preview layer using AVCaptureVideoPreviewLayer that takes up the top half of the screen. So when the user is trying to take their photo, all they can see is what the top half of the…
user3117509
  • 833
  • 3
  • 14
  • 32
16
votes
2 answers

Capture 60fps in iPhone app

I am working on a project where we will be using iPhones as cameras for capturing a scene. When recording we need to record @60fps and not 30fps (as natively supported). So I am working on an app to do this as the iPhone 4S hardware supports…
Michel
  • 357
  • 1
  • 3
  • 12
15
votes
2 answers

AVCaptureSession get Memory warning and crash with no reason

I am working on an app that manipulates HD photos. I am taking a photo with an AVCaptureSession, stopping it and then apply effects on that photo. The thing that makes me CRAZY is that everything works fine, instruments tells me that I release all…
Thomas Castel
  • 553
  • 1
  • 6
  • 11
15
votes
2 answers

Fast uploading video and play without buffering video from URL

In my Application I'm capturing 10 second of video and upload to server by FTP and Other user can watch this video by URL(s) from web service response. As per my question I want to capture video with good quality with small size so It easy to upload…
iPatel
  • 46,010
  • 16
  • 115
  • 137
15
votes
2 answers

AVCaptureSession and background audio iOS 7

Whenever I start an AVCaptureSession running with the microphone as an input it cancels whatever background music is currently running (iPod music for instance). If I comment out the line adding the audio input, the background audio continues. Does…
15
votes
3 answers

How to store video on iPhone while publishing video with RTMPStreamPublisher?

Right now I am using RTMPStreamPublisher to publish the video at wowzaserver. It's uploading there successfully, but can anyone tell me how I can store the same video on the iPhone while uploading to the server? I am using…
BhavikKama
  • 8,566
  • 12
  • 94
  • 164
15
votes
2 answers

iOS 7 AVCaptureMetadataOutput delegate (QRCode scanner)

I'm trying to implement a QRCode scanner with the new iOS 7 features but my code isn't calling the main AVCaptureMetadataOutputObjectsDelegate method. I've used the AVFoundation camera before and with my current implementation I've got the preview…
Ricardo RendonCepeda
  • 3,271
  • 4
  • 23
  • 30
14
votes
2 answers

How to add autofocus to AVCaptureSession? SWIFT

I'm using AVFoundation to recognize text and perform OCR. How do I add autofocus? I don't want to have the yellow square thing when user taps the screen, I just want it to automatically focus on the object, a credit card for example. Here is my…
mawnch
  • 385
  • 2
  • 4
  • 13
1 2
3
83 84