Code Monkey home page Code Monkey logo

llsimplecamera's People

Contributors

bluesuedesw avatar djbe avatar hapiben avatar haritonbatkov avatar htdahms avatar kylebrowning avatar leenabeena avatar leoneparise avatar liyalin avatar llinardos avatar mklb avatar omergul avatar roshannindrai avatar sachinkesiraju avatar siong1987 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

llsimplecamera's Issues

camera.startRecordingWithOutputUrl doesn't call delegate

I am using the example on the front page, and when I do camera.startRecordingWithOutputUrl,
The delegate method didStartRecording never gets called. didFinishRecording does get called, but didStart never gets called. Any ideas?

Square framed video?

For photos you just re-size camera's frame and that's it.
But for video that method does not work.

Enabling auto-flash mode

What is the proper procedure to change the flash mode, specifically to auto-flash mode?

Attempted to use updateFlashMode with CameraFlashAuto immediately following start, but the session is not yet created and the mode is not changed.

How can this reliably be accomplished? Is there a completion block where I could place the updateFlashMode call?

Orientation not working properly

If I don't have useDeviceOrientation set to YES, orientation is always flipped the wrong way.

If I do set it to YES, the output video is always landscape.

Background music pauses when camera is launched and photo is taken.

I just started using the framework and I noticed that soundcloud's music stops playing. I tried using this line of code that I searched for all over Google and Stackoverflow and found this line of code [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil]; supposedly used to keep all forms of audio playing but it does not seem to be working.

Camera display orientation issue

In the example project, if I select to enable all orientations, the camera display properly flips. If present homeViewController within my app, the orientations are behaving strangely. After the first orientation change the axis are all messed up. I am assuming this isn't a bug in your library, but any hints as to what might be different about my project that could be causing this to happen?

Quick flash of photo in opposite orientation

When using LLSimpleCamera (the example project or my own implementation of it) after capturing a photo I see a quick flash of the image in the opposite orientation before the imageViewController shows up. So if the device is in portrait mode when I take the photo, I very quickly see a flash of that image in landscape mode and then it goes into portrait again when the imageviewcontroller.

In my implementation, when I dismiss the imageviewcontroller followed by the camera one I see that sideways flash again quick.
Not sure if you're seeing the same thing.

Front Cam Video Recorder

Hello,

I have a small problem I don't know if anyone else is experiencing this, but when I try to record a video using front camera the frame of the result/output video size differs from the frame given, also the completion of the stopRecording function doesn't get called which is the even bigger problem
[self.camera stopRecording:^(LLSimpleCamera *camera, NSURL *outputFileUrl, NSError *error) {
NSLog(@"here");
}];

Anyone has any idea what's wrong here?

Thank you

Auto Focus

Is there is any way to show auto focus on Camera for photo?

Flash stays on even after starting a new session

My CameraCaptureVC comes up, I snap a picture, it goes to the ImageViewVC. I decide to retake the picture, then I snap the picture and the camera returns that its state is "LLCameraFlashOff" but flashes. Then if I try to toggle the flash button but it still always flashes. Any ideas why this may be happening? Thanks

Swift

Could you make this swift compatible aswell?

Square

How can wee get a square photo (Instagram)?
Or maybe add an "edit" step as in camera app?

Camera freeze

Hello, great code and App, easy to understand and to make changes. I just added a selfie flash to your code and works grate for me, i can help you with that if you need, by the way. I tried to use the app when i make a call and the screen got freeze, i don't know why but if i change the SessionPreset to AVCaptureSessionPresetPhoto works fine, but i can't make videos. Do you know why the screen freeze when i use the AVCaptureSessionPresetHigh and i open the app when im calling?

setOnError on Swift

Does anyone know how to set onError on Swift? I know in Objective-C, you can do:

[self.camera setOnError:^(LLSimpleCamera *camera, NSError *error) {
    // Something
}];

but on Swift, I don't have access to setOnError. I tried doing:

self.camera.onError = ({(camera : LLSimpleCamera!, error : NSError!) -> Void! in 
    // Something
})

but I would get an error. I just started working with Swift so this might be a syntax issue. Thanks for the great library and for the help!

preview frame

  • (void)attachToViewController:(UIViewController *)vc withFrame:(CGRect)frame {
    [vc.view addSubview:self.view];
    [vc addChildViewController:self];
    [self didMoveToParentViewController:vc];

    vc.view.frame = frame;
    }

this function set preview frame . but last row is set ParentVC.view frame

Torch/flash not working (iOS 8)

Hello guys.

I couldn't make flash/torch work on iOS 8.
I tried to turn the flash on in both my own project and LLSimpleCamera's example and it didn't work neither.

I tried to workaround as well but I didn't got any success.

Anybody notice that?

Thanks.

Feature request : Pinch to zoom

Hi guy,

I am not familiar with best practices to include pinch to zoom to this awesome controller.
If you have some advice, I am ready to take this in charge.

Failed to stop recording

When I'm using LLSimpleCamera for recording videos, once I pressed on recording button and then I pressed it again to stop the video. But can't stop recording. I think

self.camera.isRecording

doesn't get initialized to true after start recording.

Bug in the zoom feature

Hey,
I just pulled the latest commit on the zoom feature, and my app crashed.
Apparently, effectiveScale took a value it should not have:

* Terminating app due to uncaught exception 'NSRangeException', reason: '* -[AVCaptureVideoDevice rampToVideoZoomFactor:rate:] - the passed videoZoomFactor 1.089863 out-of-range [1, activeFormat.videoMaxZoomFactor]'

That error is one that line/
[_videoCaptureDevice rampToVideoZoomFactor:_effectiveScale withRate:10];
at the end of file LLSimpleCamera.m

I tried to put
[_videoCaptureDevice rampToVideoZoomFactor:_effectiveScale < _videoCaptureDevice.activeFormat.videoMaxZoomFactor ? _effectiveScale : _videoCaptureDevice.activeFormat.videoMaxZoomFactor withRate:10];
instead, but still I cannot zoom in.
Do I need to do anything else than pull the last commit, since _zoomEnabled is already set to YES ?

Feature request: Pause/resume recording

Kayıt yaparken, kayıdı pause moduna alıp, ardından tekrar resume edebilmek ve bunların aynı dosyada toplanıp çıktısı verilirse büyük bir eksiği kapanmış olur library'nin.

No zooming option

Please add zooming option for better experience on video recording

Embed controller crash

Hello,

There is a problem with embedding controller. No default values being set, I believe it can be fixed in few lines of code.

We need to add initWithCoder:

-(instancetype)initWithCoder:(NSCoder *)aDecoder {
    if (self = [super initWithCoder:aDecoder]) {
        [self setupWithQuality:AVCaptureSessionPresetHigh
                      position:LLCameraPositionRear
                  videoEnabled:YES];
    }
    return self;
}

And change initWithQuality:

- (instancetype)initWithQuality:(NSString *)quality position:(LLCameraPosition)position videoEnabled:(BOOL)videoEnabled
{
    self = [super initWithNibName:nil bundle:nil];
    if(self) {
        [self setupWithQuality:quality position videoEnabled:videoEnabled];
    }

    return self;
}

- (void) setupWithQuality:(NSString *)quality
                 position:(LLCameraPosition)position
             videoEnabled:(BOOL)videoEnabled {
    _cameraQuality = quality;
    _position = position;
    _fixOrientationAfterCapture = NO;
    _tapToFocus = YES;
    _useDeviceOrientation = NO;
    _flash = LLCameraFlashOff;
    _videoEnabled = videoEnabled;
    _recording = NO;   
}

Image rotation issue in iOS 9 or later

Hello,

Your camera sample is really helpful.

and you have used that orientation classes for fixing images, but when we have checked that it is having multiple issue and than main issue we faced is, its never changing image orientation and its always changes imageview orientation.

Kindly help if you can,

Thanks
Jankar

Zoom Out

Hi, Thanks for sharing,

Rear camera is seems like zoomed.
I checked with native iphone cam (with fasten the phone) from same distance in square mode. And native cam view angle is more wide. Is there any zoom value?

Thanks

Images turn out way too dark

I am taking pictures with LLSimpleCamera
This is my setup:

fullsizerender

Now I did two pictures.
The first turns out to be ok:

92b58a0c-2-0

But the second one is way too dark and has a shift in color towards blue. Even though the image looks OK on the screen when taking it.

92b58a0c-2-1

Internal reference #37

Video recording is not working

Hello,

I tried your code and photo capturing is working perfectly. But when I tried capture video then first time it capture perfect but when I tried to capture it second time then It is not capturing video.

Then I run your code without changing single line, I got same scenario. First time video capture works, but when I stop debugging and again start then video capturing is not working.

what I found was,When I click button for recording video it goes to "if(!self.camera.isRecording) " condition and when I press same button for stoping video it goes to "else condition" and that is fine.
But when I run app second time then It always go to "if(!self.camera.isRecording) " condition. It is not going in "else" condition.

if(!self.camera.isRecording) {
//always come here after I run the app for first time. every time it goes to this condition
[self.camera startRecordingWithOutputUrl:outputURL];
}
else {
[self.camera stopRecording:^(LLSimpleCamera *camera, NSURL *outputFileUrl, NSError *error) {
}];
}

I found this error : Error Domain=AVFoundationErrorDomain Code=-11823 "Cannot Save" UserInfo=0x165c36b0 {NSLocalizedRecoverySuggestion=Try saving again., AVErrorRecordingSuccessfullyFinishedKey=false, NSLocalizedDescription=Cannot Save, NSUnderlyingError=0x16514ca0 "The operation couldn’t be completed. (OSStatus error -12672.)"}

I am running your code in iOS 7.1.2 with iPhone4

So How to solve this ?

camera.capture throws AVFoundationErrorDomain Code=-11800 "The operation could not be completed"

I can see the camera on the screen, but when I call the following:

self.camera!.capture({ (camera:LLSimpleCamera!, photo:UIImage!, metadata:[NSObject : AnyObject]!, error:NSError!) -> Void in

                    if(error != nil)
                    {
                        println(error)
                    }

I get the output:

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x171066540 {NSUnderlyingError=0x174641230 "The operation couldn’t be completed. (OSStatus error -16800.)", NSLocalizedFailureReason=An unknown error occurred (-16800), NSLocalizedDescription=The operation could not be completed}

Any idea what might be happening?

Now working only Photo mode if permission to microphone not given

So here is the use case. For example i want to use it only for making photo. I added it to test project and if i'm not giving permission to use microphone but gave for using camera the screen became black(In my opinion the sound is not needed when you make photos). But make photo button still appears and focus rectangle is still working when you tap on screen.

Cannot focus camera

Hello,

I am Using some overlays that are on a scrollView ontop of the camera view. (Like snapchat where you have camera controls then can scroll up to see other controls like settings and stuff).
Because of this, my cameraView does not recognize any taps because the overlays and scrollView pick them all up.

Would you be able to make those control methods public so I can call them manually?
focusAtPoint
showFocusBox

Mirror

@omergul123 When using the back camera(both image and video) it gets mirrored.. Can you take a look at this?

This is my LLSimpleCamera.m file from Pod: http://pastebin.com/ytZk2Ti6

self.interfaceOrientation is deprecated on iOS 8

Hello there,

In LLSimpleCamera.h, self.interfaceOrientation is deprecated. Does changing it from self.interfaceOrientation to [[UIApplication sharedApplication].statusBarOrientation]; works?

stackoverflow thread for more detail.

Just for your info, I am currently testing out LLSimpleCamera on Xcode 7 GM.

Thank you!

Orientation flipped upside down

I have three orientation enabled in my view controller: both landscape and portrait orientation.

When I flip my phone from the right to the left landscape (and vice versa) the cameraview is sometimes flipped upside down.

Close a session & start another one leads to display the last state for every shoot

Hi guys great library & easy to use thank you 👍

The problem appear when close the camera session & restart another one, when trying to capture a photo the last state of the previous camera session will appear every capture shoot for a while before display the captured photo

You can replicate the problem by add [camera stop] to the existing sample in viewWillDisappear

-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [self.camera stop];
}

How to solve & thanks in advance :)

Photo Aspect Ratio

Is there any way to effect the aspect ratio of the photo? I find that the photos show up at the same aspect ratio as the entire screen, rather than the normal 4:3 (I think) iOS aspect ratio. Any help?

saving photo asset with metadata?

Hello, is it possible to enable saving photo metadata with this VC, eg. geo location? I see a pointer to metadata Dictionary in the capture method, but I'm not sure what to do with this data exactly.

MultipleShot

Hi Omer,
I found your contact thanks to cocoacontrol.com, using your pod “LLSimpleCamera”.
This pod is very useful for me because it is very simple and I added exposure controls.
Now I would like add multiple shots but all that I have tried, doesn’t work.
Have you got some advice to me ?
Thank you very much
Filippo

Video capture

I wanted to know if it's possible to configure the camera to not only capture image but video as well. Is it possible? Is there any tutorial that you can recommend me?

Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.