Cropping Video from scrollview swift - ios

I would like to implement functionality like below. i have used scrollView and based on zoom scale I tried to crop video but didn’t able to get same result. Can any one help me with this?
Link for the functioanlity which I want : https://drive.google.com/file/d/1dqGPTS494JwMktjGyPbzbIz5TG8RdyV1/view?usp=share_link
Reference url from where I tried to implement such functionality : https://www.kodeco.com/6236502-avfoundation-tutorial-adding-overlays-and-animations-to-videos
Result which I am getting :
https://drive.google.com/file/d/14D82rGPOiJBStNipXu7r-gaeosIYJz0U/view?usp=share_link
Video which I used for sample:
https://drive.google.com/file/d/14D82rGPOiJBStNipXu7r-gaeosIYJz0U/view?usp=share_link

Related

PHLivePhoto Not Playing On UICollectionViewCell

I have created a UICollectionView that will display live photo's, the live photos are stored in an array and are working fine, except when i try to display them on the UICollectionViewCell's. They just wont play.
Here's what i tried : Added a UIView and changed its class to PHLivePhotoView, i've also tried adding an UIImageView and changing it's class just in case. I tried playing the live photos programmatically with:
cell.livePhotoView.startPlaybackWithStyle(PHLivePhotoViewPlaybackStyle.Full)
Which didn't work. Tried checking if my preview image was on top of the PHLivePhotoView, it wasn't the case.
If i take this route everything works fine
let livePhotoView = PHLivePhotoView(frame: self.previewImage.frame)
self.view.addSubview(livePhotoView)
livePhotoView.startPlaybackWithStyle(PHLivePhotoViewPlaybackStyle.Full)
The above works as expected.
Has anyone experienced the same issue? I don't know what i have overlooked.

Create an animated movie of a UIVIew - perhaps using snapshotViewAfterScreenUpdates

In iOS 7 it is quite easy to create a screen shot using the new snapshotViewAfterScreenUpdates UIView method.
I would like to create a screen recording using this (perhaps a different method is better). The finial outcome should be an an animated gif - or something that can be exported and viewed in a media player.
Any suggested method to do this?

AVCam Demo OverscanCompensation implementation

I'm currently working with the AVCam demo app to present a live camera feed over airplay or apple hdmi adapter for import into a HD camera switcher.
The issue I'm having is with OverScanCompensation to remove the huge black border from the mirrored view.
The only documentation I have found is to implement the screen.overscanCompensation = 3; method someplace? I have tried to put it into viewDidLoad and it will let me, but it doesn't change anything on the external view?
I had success of sorts with the Airplay Demo (quellish) using UIImagePicker, but I would much prefer to implement AVFoundation for this exercise.
Is there a better way to achieve what I'm looking for without having to implement separate view controllers?
All you need to do is, upon setting up the external screen (via, say, if ([[UIScreen screens] count] > 1) externalScreen = (UIScreen *)[[UIScreen screens] objectAtIndex:1];), set the overscanCompensation property of the above UIScreen instance to UIScreenOverscanCompensationInsetApplicationFrame (=2). It'll entirely get rid of both the border (overscanning) and image quality-deterioating scaling.
See http://www.iphonelife.com/blog/87/tv-display-output-why-does-your-picture-have-black-border-and-how-can-it-be-fixed for more info.

How to remove the "Preview" view after I take a picture in UIImagePickerController?

I'm using UIImagePickerController to take pictures. It's quite simple. But I have a problem: There is always a "Preview" view to let me "Retake" or "Use". Which is not what I want. I want to save my pictures straight away inside my photo albums.
I've found some articles about this problem, here are some of them:
Link 1
Link 2
Basically they are using a OverlayView which can solve the problem. But there is new problem. I can't use volume up key to take pictures anymore after I use OverlayView. Are there another solution to disable the stupid "Preview" ?
Thanks
You could access the camera directly and not use UIImagePickerController at all.
Check out the following classes:
AVCaptureSession
AVCaptureDevice
AVCaptureDeviceInput
AVCaptureVideoDataOutput
With these classes you can display your own camera preview and save the image when button is pressed.
There is example here:
http://developer.apple.com/library/ios/#qa/qa1702/_index.html

Zoom image in blackberry Torch

I want to zoom image in blackberry torch.For this i am using ZoomScreen predefined class.It working but my problem is i need a screen which can contain header,some text and then one image which can be zoom in and out.
Thank you
ZoomScreen extends MainScreen, so you can set a title and a status for it by adding setTitle() and setStatus() functions. You can use normal adds too. Did you try this and did not work?

Resources