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

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.

Related

Can I avoid the native fullscreen video player in Jwplayer on iPhone

I came across this ans to avoid fullscreen video player in iPhone.Can we use this module to create video player custom controls.
I have using jwplayer and have own custom video controls (fast forward/backward, transcript, slow/fast, volume control, fullscreen).This controls gets hidden in iPhone and native iPhone video player is shown.
Is there any way to avoid this iphone fullscreen and still bring own custom controls.
Can this module be used for jwplayer? to bring own custom video control with jwplayer.
I have not seen that particular library in use with our player, so you're more than able to try it - but I cannot guarantee any success, nor can we provide support for its use.
With that being said, iOS 10 is slated to bring inline video playback to Safari for iPhone and the good news is our player is already set up in the way it needs to take advantage of this. Obviously, iOS 10 is in beta and not final yet so things are subject to change, but this is good news for those customers looking for inline video playback in Safari on iPhone.

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.

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

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).

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.

Playing video in a Customview like iPad feature

When we call MPMoviePlayerController.play method, the movie player is opened and the video is played in a separate full screen. is it possible to play a video in a custom view, that is I have an image added on a view, when this image is clicked, the image has to be removed and the video has to play there itself as the feature in iPad.
Non-full screen playback of video is possible in iPhone OS 3.2 for iPad.
If you are porting an application that uses the MPMoviePlayerController class of the Media Player framework, you must change your code if you want it to run in iPhone OS 3.2. The old version of this class supports only full-screen playback using a simplified interface. The new version supports both full- and partial-screen playback and offers you more control over various aspects of the playback.
On the full-screen question, see this section of the iPad Programming Guide for further information, and this property of MPMoviePlayerController specifically.
Bear in mind that you can still only play one video at a time, and that this is only currently possible for iPad.
Not using MPMoviePlayerController, no.
You might be able to achieve this using a custom movie player, but I haven't seen one in the wild yet, and I don't know how it would be done.