I'm apply Orientation (e.g.:- AVCaptureVideoOrientationLandscapeLeft,AVCaptureVideoOrientationPortraitUpsideDown) on object of AVCaptureVideoPreviewLayer, Its rotating the video layer perfectly, but captured image always displaying in Portrait mode.
Note: App doesn't have any orientation, its camera setting feature that rotate (0,90,180,270 degree) capture preview layer.
Transformation on captured image not working.
Related
I am new to unity and I am trying to attach my camera to a fixed background. So I have a camera object, and a sprite object that is the background, but I can't make the camera to be in the exact same height and width of the sprite background.
this is screenshots of my project:
Your camera "size", is actually made up two factors.
Orthographic size.
Aspect ratio of player.
To fit the background into the camera, change player aspect ratio to be same as background image. And then play with size to let the background cover 100% of camera view size.
I hope it is clear what I am saying, if not let me know.
I am designing a camera app in ios. I see that Video uses the whole screen in iphone 5 but camera does not. So I wanted to know the screen width and height of the camera screen that the default camera uses to design my app.
That's because unlike the feed from the video camera, the feed from the camera has a different aspect ratio from the devices screen. To rectify this, you'll need to resize your preview layer to match the aspect ratio of the feed, or you'll need to change the video gravity property of your video preview layer.
Once of these should suffice:
[myPreviewLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill];
[myPreviewLayer setVideoGravity:AVLayerVideoGravityResize];
Using coreMotion, I calculated the gyroData. Now I want to rotate an image according to the iPhone orientation. Please tell me how can I rotate the image?
A video size is dimensions: 480 × 270px. Codecs: H.264, AAC
With subtitles and it fit the width but it leave black gap on iphone screen: top and bottom of screen.
Can a video be forced to fit the screen according to height dimensions.
Check out autoresizesSubviews and contentMode View properties of the enclosing control you are having this video in - play with them in the storyboard. For your case, mostly content mode = UIViewContentModeScaleToFill should work.
the aspect ratio for a in iphone 3.x/4.x series is 4:3. any video which is in 4:3 aspect ratio will be played covering fullscreen while playing. You need to be sure that your video is according to the same aspect ratio and in video, there is no black space in original video (by checking it on any desktop's player)
UIImagePickerController on edit in preview screen with an overlay image, after scale and move the taken or selected image, to match marks on overlay image, the result edited image don't seems to maintain aspect so when merge both, overlay image and edited image, the edited image don't match the marks on overlay image, like on preview after scale and move.
How can i make the edited image still match the marks of the overlay image, when merged into a single image?
I managed to do this without enable the edit on UIImagePickerController, when i take a picture with the iPhone camera, i can see the overlay image on screen, take the picture so it match the marks on the overlay image, and when i merge them both, the taken picture still match the marks on the overlay image. (I control the orientation and scale for the merge to be successful).
I also manage to get an overlay image on the preview screen(Scale and Move), after selecting a picture from device image library.
I'm using the info dictionary to obtain the UIImagePickerControllerEditedImage, when enable the allowsEditing property of the UIImagePickerController. Also am aware of the existence of the UIImagePickerControllerCropRect in the info dictionary and the differences between images taken by the device camera and saved images in device library, not necessarily taken with device.