UiVideoEditorController change size - ios

I am captureing video use AVCaptureSession
And then Edit video using UIVideoEditorController
UIVideoEditorController *videoEditor = [[UIVideoEditorController alloc] init];
videoEditor.videoPath = recordedFile.path;
videoEditor.videoQuality = UIImagePickerControllerQualityTypeIFrame960x540;
videoEditor.delegate = self;
However Out video size is always return as 640 *360
Does anyone have idea why?

Related

Video-capture vertical output iOS

I am trying to capture video with PBJVision.
I set up camera like this
vision.cameraMode = PBJCameraModeVideo;
vision.cameraOrientation = PBJCameraOrientationPortrait;
vision.outputFormat = PBJOutputFormatWidescreen;
And this produces output 1280x720 where 1280 is width.
Setting orientation to Landscape ROTATES the stream.
I have been trying to record video with GPUImage, and there I can
videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset1280x720
cameraPosition:AVCaptureDevicePositionBack];
videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;
_movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:_movieURL size:CGSizeMake(720.0, 1280.0)];
So that i get vertical output.
I would like to achieve vertical output for PBJVision, because I experience problems with GPUImage writing video to disk. (I will make another question for that).
What method/property of AVFoundation is responsible for giving the vertical output instead of horizontal?
Sorry for the question, I have been googling 2 days - can't find the answer.
I was having the same issue. I changed the output format to vision.outputFormat = PBJOutputFormatPreset; and I'm getting that portrait/vertical output.

MPMoviePlayerViewController has aspect ration wrong for a split second

I create a movie using UIImagePickerController using the following:
self.cameraUI = [[UIImagePickerController alloc] init];
self.cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;
self.cameraUI.mediaTypes = #[(NSString *)kUTTypeMovie];
self.cameraUI.delegate = self;
self.cameraUI.videoQuality = UIImagePickerControllerQualityTypeMedium;
self.cameraUI.cameraDevice = UIImagePickerControllerCameraDeviceFront;
In the playback of the video I see that it looks good.
Then I try to load the movie with MPMoviePlayerViewController
self.player = [[MPMoviePlayerViewController alloc] initWithContentURL:self.chacha];
self.player.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[self presentMoviePlayerViewControllerAnimated:self.player];
For a split second when the movie view controller is presented the aspect ratio goes from warped to correct.
Anyone know what might be causing this? I have messed with settings for the movie controller and nothing there I have tried has helped.
Perhaps you could render it off-screen, or set it's Hidden property to YES until it finishes loading and you're sure the aspect ratio is correct.
I don't have much experience with that player.

GPUImage initWithAsset only shows last frame

I'm trying to initialize GPUImageMovie with an AVAsset, which is an AVMutableComposition. However, it will only show the last frame after it has run all benchmark frames. If I use initWithURL it works fine, but I don't want to generate a file.
I've also tried creating an AVAsset from a file URL with the same result.
_movieFile = [[GPUImageMovie alloc] initWithAsset:_myAsset];
_movieFile.runBenchmark = YES;
_movieFile.playAtActualSpeed = YES;
_filterView = [[GPUImageView alloc] initWithFrame:[self windowSize]];
Any ideas why this doesn't work?
Solved it. What I did was creating a GPUImageMovieWriter but not actually calling [movieWriter startRecording]

Camera photo mode fullscreen on iOS7

Is there a way to set the camera photo mode fullscreen on an iPod 5gen with iOS7.1? When you are going to take a photo, the photo mode is not in fullscreen, only the video mode is in fullscreen, so, is there a way to change it? (I think the same problem must happen on an iPhone 5 and greater).
Here is my code so far, it displays the control but partially, not fullscreen, and the control gets aligned to the top because the camera controls are removed from the view:
self.picker = [[UIImagePickerController alloc] init];
self.picker.delegate = self;
self.picker.allowsEditing = NO;
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.showsCameraControls = NO;
//self.picker.mediaTypes = mediaTypes; //just for the record
self.picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
self.picker.modalPresentationStyle = UIModalPresentationFullScreen;
self.picker.cameraOverlayView = [self buildOverlay]; //some custom views
[self presentViewController:self.picker animated:YES completion:NULL];
Thank you very much in advance.
Apply proper CGAffineTransform transformation in order to set camera mode.
Try out the following link this may help you:
here

Setting Move and Scale Box for iOS

I have seen several apps that after you take a picture, it shows a view for Move and Scale your picture, with a box showing what the resulting image will look like. My app takes a picture the user takes or picks from library, and adds it to a PDF file. I need this file to be a certain size to fit on the PDF, so I need to set the move and scale box accordingly, but I cannot find any documentation on how to do this. Any suggestions?
Just set the UIImagePickerController instance's allowsEditing to YES.
_imagePickerController = [[UIImagePickerController alloc] init];
...
_imagePickerController.delegate = self;
_imagePickerController.allowsEditing = YES;
The UIImagePickerController picker ONLY performs 320x320 cropping.
Try using this: https://github.com/gekitz/GKImagePicker (GKImagePicker)
Sample Code:
self.imagePicker = [[GKImagePicker alloc] init];
self.imagePicker.cropSize = CGSizeMake(320, 90);
self.imagePicker.delegate = self;
[self presentModalViewController:self.imagePicker.imagePickerController animated:YES];

Resources