piemonte / pbjvision Goto Github PK
View Code? Open in Web Editor NEW📸 iOS Media Capture – features touch-to-record video, slow motion, and photography
License: MIT License
📸 iOS Media Capture – features touch-to-record video, slow motion, and photography
License: MIT License
When a video is recorded on an iPhone 4 device (not 4S) the resulting video has large frame hitches. The audio is fine, however.
Hello again,
One more time I would like to thank you for your excellent Tool and for your help answering to my questions.
I want to inform you for a strange situation using your tool in an app that i am developing.
When I use it first for taking a photo and after for taking video......no video taken.
If I use it for taking FIRST video and after photo...everything works fine!!!!
All these happens either in IOS 6 or IOS 7.
Why? Can you take a look in that strange situation?
Thank you very much for your help.
George N. Gerardis
split out shader and GL context support into separate files
add better support for suspend/resume while recording
I need to adjust the height for the output video.. any idea how can that be achieved?
Thanks
setFlashMode: doesn't set variable _flashMode after checking if new value is different from previous one and if _currentDevice hasFlash.
Once on line 1283 by - (void)startVideoCapture
and once on line 1817 by - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
add a method to seek and record at maximum fps for slow-motion
Hi! Would you please tell me how to get to record the progress? For example: use UIProgressView display (0.0 ~ 1.0) corresponding (1 seconds to 15 seconds), because I want to be one of the biggest record limit function
Is there anyway to adjust the size/quality of the raw image to decrease memory usage upon capture?
p.s. the max resolution i require is 640x640, could you point me in the right direction on how to cater to this size with optimal memory usage?
edit: I also make adjustments to the image immediately after capture
Much thanks!
Once here:
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
and another here:
- (void)startVideoCapture
Why is it called twice? Is there another method I should be using?
Hello,
You have made an exellent work with PBJVISION.
You help all of us a lot!
But, I would like to kindly ask from you, If it is possible to have a more complete example project using all your features, e.g. Set flash on/off, set camera front/rear,
grab video/photo etc.
You will help all of us that happens to be start beginners with objective c and IOS!
Thank you in advance.
George N. Gerardis
I am implement the instagram like app
After making the video i would like to play that video using GPUImageMovie so that i can apply filter.
But when i read the movie with AVAsset , the current time frame doesn't actuall value
It's very large value , so i think that it's wrong value
Can you please advise me with this issue
Thank you
Sincerely
Buadren
how can i access elapsed recording time? i con't find any accessible property in PBJVision interface....
great work on this by the way!
__block BOOL isRecording = NO;
[self _enqueueBlockInCaptureVideoQueue:^{
isRecording = (BOOL)_flags.recording;
}];
return isRecording;
This is due to the fact that _enqueueBlockInCaptureVideoQueue
is async and therefore isRecording will always be NO.
If I have a preview view at 320x320, is there a way I can get it to record at double the resolution? Vine and Instagram seem to generate videos at 600x600 and I'd like to have that kind of resolution for viewing on the web. Can't seem to find that anywhere.
Thanks! Love the library.
do you plan on adding them?
Add setter for video maximum duration, that ends capture automatically when video reaches that duration.
Currently I'm checking for video duration in - (void)visionDidCaptureVideoSample:(PBJVision *)vision
delegate method and ending capture if - (Float64)capturedVideoSeconds
has reached the maximum desired duration, but that allows for some extra video time.
add support for onion skinning (ghosting)
PBJStrobeView.m:89:6: Receiver type 'CALayer' for instance message is a forward declaration
First of all thanks a lot for PBJVision. It has really helped me speed up the development of my app.
When my app opens, it starts in Portrait mode. Turning the iPhone sideways sets it to Landscape mode.
The problem I have is that when it's turned to Landscape, starting a recording makes the app 'freeze' for a short moment. After the freeze it starts recording like normal.
When I open the app and just start recording in Portrait mode I don't experience the freeze.
The only thing that is changed before the freeze happens is this:
[vision setCameraOrientation:cameraOrientation];
[vision setOutputFormat:PBJOutputFormatWidescreen];
[vision setFocusMode:PBJFocusModeContinuousAutoFocus];
Chaning the OutputFormat to PBJOutputFormatWidescreen causes the freeze when a new recording is started. If I remove that line it records without the freeze.
Is this a known problem? Or might I be doing something wrong?
When switching camera/mode, the current flash mode should be set if device supports it.
Example: If I start in video mode with back camera and set flash on, then switch to front camera (which doesn't support flash), then switch again to back camera, flash is off when it should be on, and the internal _flashMode camera is still PBJFlashModeOn.
Hello again,
I would like to ask if you can tell me (write) how can i take photo....and write in a file.
I know how to set up the camera....but which methods do i call to shoot a photo.
Thanks a lot...
George N. Gerardis
My photos from "capturePhoto" are coming back rotated 90 degrees to the right. I've set the camera orientation to PBJCameraOrientationPortrait and the preview shows correctly.
Here's my code: (http://i.imgur.com/aXR8znA.png).
Please check below code
}
this doesnot work properlly
What i am going to say is that when we save the movie to camera role , we can check video play well,
but i think that when you write movie , it seems that you didnt write properly .
like the timeoffset.
Please check that and advise me , i want to use your great project but currently i cannot use
Please help me
:)
Thank you
Sincerely
Buadren
Mr.Piemonte,
This is Ramanathan.
In Your SDK, the recorded path file only upload in .mov format. But doesn't upload in .mp4 format.
In Your SDK, I changed only store the recorded video in NSDocumentDirectory on PBJVision.m file using the below line,
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSDateFormatter *dateFormat = [[[NSDateFormatter alloc] init] autorelease];
[dateFormat setDateFormat:@"dd-MM-yyyy HH:mm:SS"];
NSDate *now = [[[NSDate alloc] init] autorelease];
NSString *theDate = [dateFormat stringFromDate:now];
NSString *outputPath= [[[NSString alloc] initWithString:[NSString stringWithFormat:@"%@/%@.mov",documentsDirectory,theDate]] autorelease];
_outputURL = [NSURL fileURLWithPath:outputPath];
It's uploading the .mov file format but why doesn't upload .mp4 format.
Here below I pasted the url path and output from web service. That is,
Nov 21 01:49:46 Lion-Users-iPod SedioiOS[1177] : after triming = /var/mobile/Applications/2C14E79B-4910-446D-A794-16434E28098C/Documents/21-11-2013 01:49:35.mov
��Nov 21 01:49:46 Lion-Users-iPod SedioiOS[1177] : after triming = /var/mobile/Applications/2C14E79B-4910-446D-A794-16434E28098C/Documents/21-11-2013 01:49:35.mov
Nov 21 01:49:46 Lion-Users-iPod SedioiOS[1177] : The urlvalue is = file://localhost/var/mobile/Applications/2C14E79B-4910-446D-A794-16434E28098C/Documents/21-11-2013%2001:49:35.mov
Nov 21 01:49:46 Lion-Users-iPod SedioiOS[1177] : String name:: Content-Disposition: form-data; name="uploadedfile"; filename="video-2013-11-21-01:49:46AM.mp4"
��Nov 21 01:49:59 Lion-Users-iPod SedioiOS[1177] : erro is = {
PBJVisionVideoPathKey = "/var/mobile/Applications/2C14E79B-4910-446D-A794-16434E28098C/Documents/21-11-2013 01:49:35.mov";
}
Nov 21 01:49:59 Lion-Users-iPod SedioiOS[1177] : return data
Nov 21 01:49:59 Lion-Users-iPod SedioiOS[1177] : response from server is=
Kindly Please give guidance where I was wrong.
Thank you,
This is a generally awesome project, but a lot of private methods are underscore prefixed. Apple reserves this specific convention (see "Private Methods"): https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html
Is there a way to check if the video was shot in landscape?
The above error gets called in endCaptureVideo if the audio session is manually set to ambient (i do this to replay the video immediately after capture via: [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryAmbient error:nil] )
Should we add a sessionPreset property to manage video/photo quality?
NSString *const AVCaptureSessionPresetPhoto;
NSString *const AVCaptureSessionPresetHigh;
NSString *const AVCaptureSessionPresetMedium;
NSString *const AVCaptureSessionPresetLow;
NSString *const AVCaptureSessionPreset352x288;
NSString *const AVCaptureSessionPreset640x480;
NSString *const AVCaptureSessionPreset1280x720;
NSString *const AVCaptureSessionPreset1920x1080;
NSString *const AVCaptureSessionPresetiFrame960x540;
NSString *const AVCaptureSessionPresetiFrame1280x720;
For an app I am building I need this.
Currently only these are supported:
typedef NS_ENUM(NSInteger, PBJOutputFormat) {
PBJOutputFormatPreset = 0,
PBJOutputFormatSquare,
PBJOutputFormatWidescreen
};
I also wonder if its already possible by using the Preset
setting and setting the dimensions elsewhere.
I will fork and implement otherwise.
Add a method to determine if current device has flash in order to show toggle flash UI.
Example code below:
-(BOOL)currentDeviceHasFlash {
return [_currentDevice hasFlash];
}
hello! How to add focus function? When why iOS5.0.1 debugging isVideoStabilizationSupported and finishWritingWithCompletionHandler errors? Does not support the ios 5?
Mr.Piemonte,
This is Ramanathan.
Thanks for give the custom video record project like vine. Really it's useful for me but it was very difficult to understand and touch to me. Because I'm new for developing apps for iPhone.
Now I have one doubts from your project that is, I get the recorded video path from
(void)vision:(PBJVision *)vision capturedVideo:(NSDictionary *)videoDict error:(NSError *)error
then I try to upload that video path follow the method(-(void)upload) of below instruction link
Here I have only get the below response from server like below
Nov 13 05:55:41 Lion-Users-iPod Vision[17484] : return data <0909>
Nov 13 05:55:41 Lion-Users-iPod Vision[17484] : response from server is=
So I try to upload another method that is, I create another project and drag drop inside the local video like video1.mp4 to that project.
And set that video as [[NSBundle mainBundle] pathForResource:@"video1" ofType:@".mp4"];
And change NSUrl and convert NSdata. Here It was working that video upload onto the server following the above stackoverflow link method(uploadvideo).
But I can't understand and Identify why the recorded video doesn't upload and get empty response from server using your video path.
I request you to Kindly give some guidance.
Thanks..
It seems _focusMode
is never user (only has getter and setter), even in - (void)focusAtAdjustedPoint:(CGPoint)adjustedPoint
the focus mode set is AVCaptureFocusModeAutoFocus
after setting focus POI instead of setting previous focus mode.
I'm not used to git forking and making pull requests, so I'll leave sample code here:
-(void)setFocusMode:(PBJFocusMode)focusMode {
BOOL shouldChangeFocusMode = (_focusMode != focusMode);
if (![_currentDevice isFocusModeSupported:(AVCaptureFocusMode)focusMode] || !shouldChangeFocusMode)
return;
_focusMode = focusMode;
NSError *error = nil;
if (_currentDevice && [_currentDevice lockForConfiguration:&error]) {
[_currentDevice setFocusMode:(AVCaptureFocusMode)focusMode];
[_currentDevice unlockForConfiguration];
} else if (error) {
DLog(@"error locking device for focus mode change (%@)", error);
}
}
in - (void)focusAtAdjustedPoint:(CGPoint)adjustedPoint
:
if (isFocusAtPointSupported && [_currentDevice isFocusModeSupported:AVCaptureFocusModeAutoFocus]) {
//is it really necessary to reset focus mode???
AVCaptureFocusMode fm = [_currentDevice focusMode];
[_currentDevice setFocusPointOfInterest:adjustedPoint];
[_currentDevice setFocusMode:fm];
}
Also the focus mode should be set when changing device.
Add a flag that allows to disable thumbnail creation when capturing photo, sparing some processing time when the functionality is not needed (in iPhone4S it took consistently ~200ms to generate image thumbnails)
Using your excellent tools in an app for capturing photo each time using the tool the memory increases rapidly and when dismissing the conroller in which I use your tool memory does not been released. The result is that after some times ( 4-5 ) the app crashes because of memory leak.
Can you see this issue?
Thanks a lot for your help
George N. Gerardis
Hi Patrick,
Amazing work!
By the way, please can you help assist how I can get this working for iPhone 4 and 4s as well?
Thanks much.
Regards,
Manan
I'm getting mirrored images from capturePhoto.
When fixing issue #28 the value from orientation should be converted has shown in http://stackoverflow.com/a/14553970/1077288
split out file writing into PBJVideoWriter
I am having this issue. If I setup PBJCameraModePhoto at start and toggle cam mode later, I get the error "AVASSETWRITERSTATUSUNKNOWN". Can you please help on it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.