How to implement digital zooming in video with iphone device camera? - iphone

In an iPhone App, I have to implement a feature such that user can make video through iPhone app and digitally zoom it also. Digital zoom feature should work while making videos. Any ideas how can I implement this?

Check out wikipedia. Bilinear is common because its fast (but the results are low quality).

Related

How to make video backgrounds play on iPhone / mobile?

We are planning to use After Effects video as our banner / hero image as our animation sequence is a bit complex. However, when we've seen examples of websites using this technique, the iPhone / mobile versions are static.
Is there a way to make the video backgrounds work on iPhone also? What are the possible workarounds?
We're thinking that we can use the full video animation on desktop and then have a shorter GIF version for mobile (it's still animating).
Or are there other ways to achieve this?
There are many ways to achieve the sort of effect you're after.
If a very low frame rate is acceptable, using a GIF or sequence of static images with transitions may be good enough.
If the areas of movement are not huge, you can use spritesheet animation. You might even be able to present video for the whole screen if it isn't too long. You can letterbox the video or present it in low resolution scaled up to reduce the size of the spritesheet needed.
You can use a combination of panning backgrounds and moving sprites to create a dynamic video background. Particle effects, lighting effects, all the things the GPU does in real time games can be applied to make the menu background look like video.
In theory you might be able to port OpenH264 to your target platforms and play video natively, but that's probably beyond the scope of what you want to do.
You can't use HTML5 video for that with mobile Safari as playback of inline video is prohibited on iPhone. You could do it on Chrome for Android but playback would require a valid user interaction to start (touchstrart).
You are left with either JavaScript/CSS animations or like you mentioned animated images. APNG may provide a better alternative that GIF on iOS.
I have seen other solutions but none provide a decent user experience - a static image may not be a bad idea if you do not want to spend too much time on it.
Note: if you are building an App you can play inline video on iPhone. The restriction is only for mobile Safari.

Is it possible to programmatically capture iPhone 5S slow motion video?

I couldn't find an answer to this question, and looking at Apples own apps like iMovie on iOS, the video picker does not offer a slow motion option on the iPhone 5S.
The image picker offers very little control over the video. If you are willing to dive deeper into the APIs you can use AVFoundation to capture your video and manipulate the camera properties as you see fit.
iOS 7 introduces a new AVCaptureDeviceFormat class that will give you the maximum and minimum supported frame-rates for the capture device, and you can use these to set a custom frame rate on the camera itself. I don't have an iPhone 5S to hand so I can't actually verify whether this API goes all the way down to 120FPS.

It is possible to record video in iPhone device screen off mode?

Am working in iPhone device camera based iOS application. I have one requirement to record video from our application even the device screen is off or in locked. I don't have iPhone, iPod and iPad. And also i don't know it is possible to record video in these conditions. Cound you please give me any idea on this? Looking forward your help. Thanks in advance.
No this is not possible. There's no other way to achieve this.
In some countries it's against the law to even take picture without sound effect, such as Japan for example. No wonder Apple don't allow to shoot pictures from locked screen.

AVFoundation Camera Preview Screen gives wrong zoom

I'm currently developing an app that has a camera functionality, with a custom camera screen, featuring a preview screen and an overlay.
I'm using the AVFoundation classes and methods as per the eradication of UIScreenCapture.
The problem I have is that the preview data I get from AVCaptureSession is too zoomed in. If i take a picture with that screen, and another with the iPhone's default camera app, without moving the iPhone, the difference in zoom is far too much.
I need the zoom of my app to be the same as is default for iPhone camera app.
I've tried changing the AVCaptureVideoPreviewLayer.videoGravity, to any of it's 3 possible values, to no avail.
Please, any leads on this problem are truly appreciated.
Arcantos' solution was mostly correct. That will work assuming you're on an iPhone 3G (or any device with a camera that supports 640x480). An iPhone 4 may run into some issues there.
A more correct way would be to test for the availability of and apply this preset:
captureSession.sessionPreset = AVCaptureSessionPresetPhoto;
This will use the raw camera data, regardless of the native resolution.
Turned out to be a resolution issue.
It was fixed by using
myCaptureSession.sessionPreset = AVCaptureSessionPreset640x480
Note that iPhone 3g does not support that, so you have to ask wheter the device supports it
[[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo] supportsAvCaptureSessionPreset:AVCaptureSessionPreset640x480]
Is the aspect ratio of your preview pane identical to that of the camera capture data? If not, the OS may be changing the zoom to fit the data rect into your requested aspect ratio.

iPhone Camera API and Zoom

I am just curious as to how current ZOOM-Camera Apps on the AppStore are implemented (Are they using undocumented APIs?)
They're probably just cropping into a section of a photo, and interpolating it bigger. Since there's no hardware zoom in the phone, you have to "fake" it.