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 8053517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:52:22+00:00 2026-06-05T07:52:22+00:00

The Apple docs seem to indicate that while recording video to a file, the

  • 0

The Apple docs seem to indicate that while recording video to a file, the app can change the URL on the fly with no problem. But I’m seeing a problem. When I try this, the recording delegate gets called with an error…

The operation couldn’t be completed. (OSStatus error -12780.) Info
dictionary is: {
AVErrorRecordingSuccessfullyFinishedKey = 0; }

(funky single quote in “couldn’t” comes from logging [error localizedDescription])

Here’s the code, which is basically tweaks to WWDC10 AVCam sample:

1) Start recording. Start timer to change the output URL every few seconds

- (void) startRecording
{
    // start the chunk timer
    self.chunkTimer = [NSTimer scheduledTimerWithTimeInterval:5
                                                       target:self
                                                     selector:@selector(chunkTimerFired:)
                                                     userInfo:nil
                                                      repeats:YES];

    AVCaptureConnection *videoConnection = [AVCamCaptureManager connectionWithMediaType:AVMediaTypeVideo fromConnections:[[self movieFileOutput] connections]];
    if ([videoConnection isVideoOrientationSupported]) {
        [videoConnection setVideoOrientation:[self orientation]];
    }

    if ([[UIDevice currentDevice] isMultitaskingSupported]) {
        [self setBackgroundRecordingID:[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{}]];
    }

    NSURL *fileUrl = [[ChunkManager sharedInstance] nextURL];
    NSLog(@"now recording to %@", [fileUrl absoluteString]);
    [[self movieFileOutput] startRecordingToOutputFileURL:fileUrl recordingDelegate:self];
}

2) When the timer fires, change the output file name without stopping recording

- (void)chunkTimerFired:(NSTimer *)aTimer {

    if ([[UIDevice currentDevice] isMultitaskingSupported]) {
        [self setBackgroundRecordingID:[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{}]];
    }

    NSURL *nextUrl = [self nextURL];
    NSLog(@"changing capture output to %@", [[nextUrl absoluteString] lastPathComponent]);

    [[self movieFileOutput] startRecordingToOutputFileURL:nextUrl recordingDelegate:self];
}

Note: [self nextURL] generates file urls like file-0.mov, file-5.mov, file-10.mov and so on.

3) This gets called each time the file changes, and every other invocation is an error…

- (void)              captureOutput:(AVCaptureFileOutput *)captureOutput
didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL
                    fromConnections:(NSArray *)connections
                              error:(NSError *)error
{
    id delegate = [self delegate];
    if (error && [delegate respondsToSelector:@selector(someOtherError:)]) {
        NSLog(@"got an error, tell delegate");
        [delegate someOtherError:error];
    }

    if ([self backgroundRecordingID]) {
        if ([[UIDevice currentDevice] isMultitaskingSupported]) {
            [[UIApplication sharedApplication] endBackgroundTask:[self backgroundRecordingID]];
        }
        [self setBackgroundRecordingID:0];
    }

    if ([delegate respondsToSelector:@selector(recordingFinished)]) {
        [delegate recordingFinished];
    }
}

When this runs, file-0 gets written, then we see error -12780 right after changing the url to file-5, file-10 gets written, then an error, then okay, and so on.

It’s appears that changing the URL on the fly doesn’t work, but it stops the writing which allows the next URL change to work.

  • 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-06-05T07:52:23+00:00Added an answer on June 5, 2026 at 7:52 am

    Thanks all, for the review and good thoughts on this. Here’s the word from Apple DTS…

    I spoke with our AV Foundation engineers, and it is definitely a bug
    in that this method is not doing what the documentation says it should
    (“You do not need to call stopRecording before calling this method
    while another recording is in progress.”). Please file a bug report
    using the Apple Bug Reporter (http://developer.apple.com/bugreporter/)
    so the team can investigate. Make sure and include your minimal
    project in the report.

    I’ve filed this with Apple as bug 11632087

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

Sidebar

Related Questions

I'm facing that crash while keyboard is shown. As suggested in Apple docs I'm
What's the purpose of NSCache's name? The Apple docs only say that you can
In the Apple Docs, they say that NSDateFormatter uses the Unicode for spec. I've
From reading the Apple Docs on Core Data, I've learned that you should not
I am integrated adWhirl in my iOS app successfully. I read in Apple docs
In the Apple docs it says that JavaScript execution time is limited to 10
I was looking at the Apple docs for UIScrollView and saw that the constants
I've been browsing the Apple docs for a while now, but haven't seen a
According to Apple Docs NSCalendar is not thread-safe . How can I ensure thread-safety
I have been browsing the apple docs and stackoverflow for a while now, but

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.