Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4335620
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:41:42+00:00 2026-05-21T10:41:42+00:00

I am facing a strange issue with videoMaximumDuration property in Video recorder API. I

  • 0

I am facing a strange issue with videoMaximumDuration property in Video recorder API. I am trying to fix this issue more than a week, but couldn’t. I posted in several forums, but no help yet.

I am using the following code to launch Camera from my application and start recording the video. As per my requirement, i should set the time duration for recording the video to stop. So, i use “videoMaximumDuration” property to set the time duration for recording the video.

if ([types containsObject:(id)kUTTypeMovie])
{
    appDelegate.pickerController = [[UIImagePickerController alloc] init];
    appDelegate.pickerController.delegate = self;
    appDelegate.pickerController.videoQuality = setVideoQuality;

       appDelegate.pickerController.allowsEditing = NO;
    appDelegate.pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
    appDelegate.pickerController.showsCameraControls = YES;
    appDelegate.pickerController.navigationBarHidden = YES;
    appDelegate.pickerController.toolbarHidden = YES;
    appDelegate.pickerController.wantsFullScreenLayout = YES;
    appDelegate.pickerController.cameraViewTransform =
    CGAffineTransformScale(appDelegate.pickerController.cameraViewTransform,
                           CAMERA_TRANSFORM_X,
                           CAMERA_TRANSFORM_Y);
    appDelegate.pickerController.mediaTypes = [NSArray arrayWithObject:(id)kUTTypeMovie];
    appDelegate.pickerController.videoMaximumDuration = maxDuration;
    [self presentModalViewController:appDelegate.pickerController animated:YES];
}

Here is the issue:

If if i set videoQuality as UIImagePickerControllerQualityTypeHigh, then the time duration(videoMaximumDuration) works as expected, i.e exactly after the time duration it stops recording the video automatically. If i go and see that recorded video in Photo album to make sure that, it is recorded well as per the time.
If i change the videoQuality to UIImagePickerControllerQualityTypeMedium (or) UIImagePickerControllerQualityTypeLow like that, then the time duration(videoMaximumDuration) for video recording is not working as expected,
i.e. it is able to automatically stop the video recording at the time duration set, no issues, But if i go and see that recorded video in Photo album to make sure, it is NOT as per the time taken, rather i can see the smaller video than what i recorded. For example, if i set the videoMaximumDuration for 30 seconds, after recording the video, if i go and see that recorded video in Photo album, it could able to record= only unto 22 seconds. Seems to be issue with the API itself. This is not happening when i use video quality as UIImagePickerControllerQualityTypeHigh.

I tried even using Custom overlay view and do start and stop recording video through code like below by setting timer(NStimer). But still i see the same issue has observed.

    overlay = [[OverlayView alloc]initWithFrame:CGRectMake(0, 0, 768, 1024)];

if ([types containsObject:(id)kUTTypeMovie])
{
    appDelegate.pickerController = [[UIImagePickerController alloc] init];
    appDelegate.pickerController.delegate = self;
    appDelegate.pickerController.videoQuality = setVideoQuality;

   appDelegate.pickerController.allowsEditing = NO;
    appDelegate.pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
    appDelegate.pickerController.showsCameraControls = NO;
    appDelegate.pickerController.navigationBarHidden = YES;
    appDelegate.pickerController.toolbarHidden = YES;
    appDelegate.pickerController.wantsFullScreenLayout = YES;
    appDelegate.mTimerSelectionForVideo = maxDuration; // TIME SET HERE IN VARIABLE
    appDelegate.pickerController.cameraViewTransform =
    CGAffineTransformScale(appDelegate.pickerController.cameraViewTransform,
                           CAMERA_TRANSFORM_X,
                           CAMERA_TRANSFORM_Y);
    appDelegate.pickerController.mediaTypes = [NSArray arrayWithObject:(id)kUTTypeMovie];
    appDelegate.pickerController.videoMaximumDuration = maxDuration;
    [self presentModalViewController:appDelegate.pickerController animated:YES];  
    appDelegate.pickerController.cameraOverlayView =overlay;
}

OverlayView.m

    -(void)startAction:(id)sender
{
    BOOL bStop = TRUE;

    void (^hideControls)(void);
    hideControls = ^(void) {
        cameraSelectionButton.alpha = 0;
        startButton.enabled = NO;
        lbl.hidden = NO;
    };

    void (^recordMovie)(BOOL finished);
    recordMovie = ^(BOOL finished) {
        stopButton.enabled = YES;
        [appDelegate.pickerController startVideoCapture];
    };

    // Hide controls
    [UIView  animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:hideControls completion:recordMovie];

    if ( appDelegate.mTimerSelectionForVideo==0 )
    {
        bStop = FALSE;
    }
    if ( bStop )
        timer = [NSTimer scheduledTimerWithTimeInterval:(appDelegate.mTimerSelectionForVideo)+1 
                                             target:self selector:@selector(stopCamera:) userInfo:nil repeats:NO];
}
- (void)stopCamera:(NSTimer *)theTimer
{
    startButton.enabled = YES;

    if ( timer )
    {
        [timer invalidate];
        timer = nil;    
    }    
    [appDelegate.pickerController stopVideoCapture];
    [appDelegate.pickerController dismissModalViewControllerAnimated:YES];
}

But still i see the same issue observed. Why does other video quality settings not working as per the videoMaximumDuration set?
I tested on iPhone 4.1 and iPad 4.3, the same issue has been observed. Looks like, issue with the API or video recorder hardware itself to support it.

Could someone please guild me to fix this issue if there is any possibility (or) through your experience?

Thank you in Advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:41:43+00:00Added an answer on May 21, 2026 at 10:41 am

    Fixed it by creating an overlay view on top of the camera view and handle start/stop thru code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm facing a strange issue, I'm trying to localize a website, so i converted
I'm facing a rather strange Issue when trying to load data from an XML-Webservice.
Im facing a strange issue trying to move from sql server to oracle. in
I'm facing a strange issue using the Criteria API. I want to dynamically add
I am facing a very strange issue with FileInfo and the Length property. I
I am facing strange issue on Windows CE: Running 3 EXEs 1)First exe doing
I am facing a very strange issue. I have a SharePoint webpart that displays
I'm facing kind of a strange issue which is related MD5-Hashes in Java and
I am facing a strange issue after the popup is created onclick . The
I am facing very strange issue. When I was running my app in iPhone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.