Results 1 to 7 of 7
  1. #1


    Member Since
    Mar 13, 2012
    Posts
    3
    Is this possible with xcode ?
    I am making an iphone camera app.

    I would like to know if this is possible:

    When you push the camera button, it starts a recording but also makes a file with the exact time (maybe a php file that requests actual server time ?)

    does anyone know if this is possible ?

  2. #2

    Mark FX's Avatar
    Member Since
    Aug 13, 2011
    Location
    West Sussex, UK
    Posts
    186
    Yes this is possable.

    The first and easiest way to use the camera on your iOS device, is with the
    UIImagePickerController class, you can find the documentation fro this class at this link.

    https://developer.apple.com/library/...uid/TP40007070

    https://developer.apple.com/library/...uid/TP40007069

    Also there is Apple developer documentation related to using the devices camera, this is
    also worth reading, you can find it at this link.

    https://developer.apple.com/library/...uid/TP40010400

    Regards Mark

  3. #3


    Member Since
    Mar 13, 2012
    Posts
    3
    is there a way to export the exact time when someone pushes the button to a text file

  4. #4

    Mark FX's Avatar
    Member Since
    Aug 13, 2011
    Location
    West Sussex, UK
    Posts
    186
    Yes you can do that, but you would not use the UIImagePickerController to create the time,
    but would use a NSDate and NSDateFormatter to create an NSString that could be saved to
    a file.

    You would properbly create these other classes and NSString in one of the UIImagePickerController's delegate methiods, possably the

    UIImagePickerController : didFinishPickingMediaWithInfo :

    method would be a good choice.

    Hope this gives you some ideas and guidance.

    Regards Mark

  5. #5

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    You can actually write meta data to the QuickTime file. Well, at least using AV Foundation.

    And of course you can create an independent file with what ever you want. You'll want to set sharing of your Documents folder so that iTunes can see the files for transferring. That I believe is just a plist entry.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  6. #6


    Member Since
    Mar 13, 2012
    Posts
    3
    hmm i came up with another idea

    lets i make a record app

    so someone opens the app and he can use the app to record with the camera but i want to make sure that when he starts recording (he pushes the button to record) he gets the server time (from my server) not the iPhone time.. and that time should be stored somewhere (or in the meta data of the video file !)

    what is the best way to to this...any heads up ?

  7. #7

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    I haven't been here for a while and just saw your response.

    You'll have to figure out how to get the server timestamp, but what if the server ins't available. I think I'd have the app sync to the server and keep track of the time offset from UTC.

    As far as the meta data, look into AVMutableMetadataItem. Here is a bit of sample code.

    Code:
    NSMutableArray * myMetadata = [[NSMutableArray new] autorelease];
    AVMutableMetadataItem * metadataItem;
    
    metadataItem = [AVMutableMetadataItem metadataItem];
    metadataItem.keySpace = AVMetadataKeySpaceCommon;		
    metadataItem.key = AVMetadataCommonKeySoftware;
    metadataItem.value = @"CameraTime 1.1";
    [myMetadata addObject: metadataItem];		
    
    outputWriter = [AVAssetWriter assetWriterWithURL: [projectPaths movieURLPath] fileType: AVFileTypeQuickTimeMovie error: &error];
    [outputWriter retain];
    
    <A a bunch of setup here for outputWriter>
    
    // You must do this before starting the outputWriter.
    outputWriter.metadata = myMetadata;
    		
    [outputWriter startWriting];
    The key you're looking for may be AVMetadataCommonKeyCreationDate or AVMetadataCommonKeyLastModifiedDate.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Xcode stopped letting me run Xcode app on iPad
    By ildsarria in forum iOS Development
    Replies: 1
    Last Post: 11-09-2011, 03:15 PM
  2. XCode 4 and C++
    By applefan90 in forum OS X - Development and Darwin
    Replies: 4
    Last Post: 03-22-2011, 01:12 AM
  3. Xcode use help
    By chat19 in forum OS X - Development and Darwin
    Replies: 8
    Last Post: 05-26-2008, 08:12 AM
  4. Xcode 1.5
    By alejandrico in forum OS X - Development and Darwin
    Replies: 0
    Last Post: 06-03-2006, 05:56 PM
  5. XCode
    By meskue in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 05-21-2006, 02:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •