Ошибка 3302 айфон

I’m trying to save a video/image after recording/taking a picture and I’m getting «There was a problem writing this asset because the data is invalid and cannot be viewed or played».

Error code is -3302. The thing is that I’m not really doing anything with the data before attempting to save it.
Here’s the code I run:

Code:

-(void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
{      
    NSURL* mediaURL = [info objectForKey:UIImagePickerControllerMediaURL];

    if(mediaURL)
    {   //The user has recorded a video and it's kept on a temporary directory
       if(UIVideoAtPathIsCompatibleWithSavedPhotosAlbum([mediaURL path]))
       {
           //Save the video to user library
           UISaveVideoAtPathToSavedPhotosAlbum([mediaURL path], self,               @selector(video:didFinishSavingWithError:context:), nil);                                        

           //Remove it from the temporary directory it was saved at
           [[NSFileManager defaultManager] removeItemAtPath:[mediaURL path] error:nil];
       }
   }
}

And that’s it. Do I need to do something to the data before attempting to save it?

Thanks.

asked Aug 11, 2011 at 15:24

mdonati's user avatar

Load 7 more related questions

Show fewer related questions

I’m trying to save a video/image after recording/taking a picture and I’m getting «There was a problem writing this asset because the data is invalid and cannot be viewed or played».

Error code is -3302. The thing is that I’m not really doing anything with the data before attempting to save it.
Here’s the code I run:

Code:

-(void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
{      
    NSURL* mediaURL = [info objectForKey:UIImagePickerControllerMediaURL];

    if(mediaURL)
    {   //The user has recorded a video and it's kept on a temporary directory
       if(UIVideoAtPathIsCompatibleWithSavedPhotosAlbum([mediaURL path]))
       {
           //Save the video to user library
           UISaveVideoAtPathToSavedPhotosAlbum([mediaURL path], self,               @selector(video:didFinishSavingWithError:context:), nil);                                        

           //Remove it from the temporary directory it was saved at
           [[NSFileManager defaultManager] removeItemAtPath:[mediaURL path] error:nil];
       }
   }
}

And that’s it. Do I need to do something to the data before attempting to save it?

Thanks.

При попытке сохранить файл записи экрана на моем устройстве, например:

PHPhotoLibrary.shared().performChanges({() -> Void in
                    PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: url)
                }, completionHandler: { (_, error) -> Void in
                    if let error = error {
                        self.showAlert(title: .saveFailed, message: error.localizedDescription)
                        return
                    }
                    do {
                        try FileManager.default.removeItem(at: url)
                        self.showAlert(title: .saved) {
                            self.dismissSelf()
                        }
                    } catch let error {
                        print(error)
                    }
                })

Иногда вылетает с ошибкой:

Domain=PHPhotosErrorDomain Code=3302

Что означает:

case invalidResource = 3302 // Asset resource validation failed

Хотя иногда это удается. Кто-нибудь знает, что означает ошибка invalidResource ??

1 ответ

В моем случае URL-адрес требует расширения файла, например. .gif.


0

hstdt
15 Ноя 2022 в 11:29

Looks like no one’s replied in a while. To start the conversation again, simply

ask a new question.

hi, when I want to upload photos to a shared album, I get an error ‘PHPhotosErrorDomain error 3302’, and no photo is uploaded in the shared album. Kindly assist.

Posted on Jul 14, 2022 1:47 AM

Similar questions

  • Can’t Upload Photos to Shared Album
    I have created a shared album and have tried to add photos by both the «drag and drop» method and «adding photos» from the option within the album.I get an odd error message that says «Internet Connection Required- An internet connection is required to download larger versions of these items for sharing,» and no photos end up in the album, the album remains empty.I am most certainly connected to the internet.Any thoughts?

    3745
    8

  • Shared Album not loading photos
    My shared album isn’t loading the photos, and when I click on them they are just gray squares. How do I make them load?

    651
    1

  • Can’t upload photos to shared cloud album
    Dear folks,

    All the time I try to upload photos to the shared cloud album I created, the system starts to prepare it and then it crashes.

    I’ve uploaded about 500 photos to this album already step by step, sending 20-50 photos per each upload, but now it goes down even when I try to upload 5+ photos.

    Please advise?

    Thank you.

    112
    1

4 replies

Jul 14, 2022 1:53 PM in response to baba masele

Hi

Are you able to open these images in edit mode?

Do you use iCloud photos with optimise mac storage selected?

Jul 15, 2022 5:48 AM in response to baba masele

Once you have opened an image in edit mode, are you then able to add it to the shared album?

Jul 15, 2022 6:22 AM in response to TonyCollinet

hi, if I go to Add photos in that album, I can add photos. But, if I select a person in people’s album, and chose to add that person in the shared album (named after that person), I get that error. Basically, I have created a shared album of my son called, Samuel, and I want to put all of Samuel’s photos in the shared album. It’s not working.

Uploading photos to shared album

I am processing an H264 encoded video stream from a non-apple IoT device. I want to record bits of this video stream.

I’m getting an error when I try to save to the photo gallery:

The operation couldn’t be completed. (PHPhotosErrorDomain error 3302.)

My Code, let me know if I need to share more:

  private func beginRecording() {
    self.handlePhotoLibraryAuth()
    self.createFilePath()
    guard let videoOutputURL = self.outputURL,
       let vidWriter = try? AVAssetWriter(outputURL: videoOutputURL, fileType: AVFileType.mp4),
       self.formatDesc != nil else {
         print("Warning: No Format For Video")
         return
       }
    let vidInput = AVAssetWriterInput(mediaType: AVMediaType.video, outputSettings: nil, sourceFormatHint: self.formatDesc)
    guard vidWriter.canAdd(vidInput) else {
      print("Error: Cant add video writer input")
      return
    }
     
    let sourcePixelBufferAttributes = [
      kCVPixelBufferPixelFormatTypeKey as String: NSNumber(value: kCVPixelFormatType_32ARGB),
      kCVPixelBufferWidthKey as String: "1280",
      kCVPixelBufferHeightKey as String: "720"] as [String : Any]
     
    self.videoWriterInputPixelBufferAdaptor = AVAssetWriterInputPixelBufferAdaptor(
      assetWriterInput: vidInput,
      sourcePixelBufferAttributes: sourcePixelBufferAttributes)
    vidInput.expectsMediaDataInRealTime = true
    vidWriter.add(vidInput)
    guard vidWriter.startWriting() else {
      print("Error: Cant write with vid writer")
      return
    }
    vidWriter.startSession(atSourceTime: CMTimeMake(value: self.videoFrameCounter, timescale: self.videoFPS))
    self.videoWriter = vidWriter
    self.videoWriterInput = vidInput
    print("Recording Video Stream")
  }

Save the Video

  private func saveRecordingToPhotoLibrary() {
    let fileManager = FileManager.default
    guard fileManager.fileExists(atPath: self.path) else {
      print("Error: The file: (self.path) not exists, so cannot move this file camera roll")
      return
    }
    print("The file: (self.path) has been save into documents folder, and is ready to be moved to camera roll")
    PHPhotoLibrary.shared().performChanges({
      PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: URL(fileURLWithPath: self.path))
    }) { completed, error in
      guard completed else {
        print ("Error: Cannot move the video (self.path) to camera roll, error: (String(describing: error?.localizedDescription))")
        return
      }
      print("Video (self.path) has been moved to camera roll")
    }
  }

 When Recording ends we save the video

  private func endRecording() {
    guard let vidInput = videoWriterInput, let vidWriter = videoWriter else {
      print("Error, no video writer or video input")
      return
    }
    vidInput.markAsFinished()
    if !vidInput.isReadyForMoreMediaData {
      vidWriter.finishWriting {
        print("Finished Recording")
        guard vidWriter.status == .completed else {
          print("Warning: The Video Writer status is not completed, status: (vidWriter.status.rawValue)")
          print(vidWriter.error.debugDescription)
          return
        }
        print("VideoWriter status is completed")
        self.saveRecordingToPhotoLibrary()
      }
    }
  }
Icon Ex Номер ошибки: Ошибка 3302
Название ошибки: Microsoft Access Error 3302
Описание ошибки: Cannot change a rule while the rules for this table are in use.
Разработчик: Microsoft Corporation
Программное обеспечение: Microsoft Access
Относится к: Windows XP, Vista, 7, 8, 10, 11

Анализ «Microsoft Access Error 3302»

«Microsoft Access Error 3302» обычно называется формой «ошибки времени выполнения». Когда дело доходит до Microsoft Access, инженеры программного обеспечения используют арсенал инструментов, чтобы попытаться сорвать эти ошибки как можно лучше. Хотя эти превентивные действия принимаются, иногда ошибки, такие как ошибка 3302, будут пропущены.

Некоторые люди могут столкнуться с сообщением «Cannot change a rule while the rules for this table are in use.» во время работы программного обеспечения. После того, как об ошибке будет сообщено, Microsoft Corporation отреагирует и быстро исследует ошибки 3302 проблемы. Разработчик сможет исправить свой исходный код и выпустить обновление на рынке. Если есть уведомление об обновлении Microsoft Access, это может быть решением для устранения таких проблем, как ошибка 3302 и обнаруженные дополнительные проблемы.

В большинстве случаев вы увидите «Microsoft Access Error 3302» во время загрузки Microsoft Access. Вот три наиболее распространенные причины, по которым происходят ошибки во время выполнения ошибки 3302:

Ошибка 3302 Crash — она называется «Ошибка 3302», когда программа неожиданно завершает работу во время работы (во время выполнения). Это происходит много, когда продукт (Microsoft Access) или компьютер не может обрабатывать уникальные входные данные.

Утечка памяти «Microsoft Access Error 3302» — последствия утечки памяти Microsoft Access связаны с неисправной операционной системой. Возможные искры включают сбой освобождения, который произошел в программе, отличной от C ++, когда поврежденный код сборки неправильно выполняет бесконечный цикл.

Ошибка 3302 Logic Error — Вы можете столкнуться с логической ошибкой, когда программа дает неправильные результаты, даже если пользователь указывает правильное значение. Это видно, когда исходный код Microsoft Corporation содержит недостаток в обработке данных.

Такие проблемы Microsoft Access Error 3302 обычно вызваны повреждением файла, связанного с Microsoft Access, или, в некоторых случаях, его случайным или намеренным удалением. Как правило, любую проблему, связанную с файлом Microsoft Corporation, можно решить посредством замены файла на новую копию. Помимо прочего, в качестве общей меры по профилактике и очистке мы рекомендуем использовать очиститель реестра для очистки любых недопустимых записей файлов, расширений файлов Microsoft Corporation или разделов реестра, что позволит предотвратить появление связанных с ними сообщений об ошибках.

Типичные ошибки Microsoft Access Error 3302

Обнаруженные проблемы Microsoft Access Error 3302 с Microsoft Access включают:

  • «Ошибка Microsoft Access Error 3302. «
  • «Недопустимый файл Microsoft Access Error 3302. «
  • «Извините, Microsoft Access Error 3302 столкнулся с проблемой. «
  • «Microsoft Access Error 3302 не может быть найден. «
  • «Отсутствует файл Microsoft Access Error 3302.»
  • «Проблема при запуске приложения: Microsoft Access Error 3302. «
  • «Microsoft Access Error 3302 не работает. «
  • «Microsoft Access Error 3302 остановлен. «
  • «Microsoft Access Error 3302: путь приложения является ошибкой. «

Проблемы Microsoft Access Error 3302 с участием Microsoft Accesss возникают во время установки, при запуске или завершении работы программного обеспечения, связанного с Microsoft Access Error 3302, или во время процесса установки Windows. Выделение при возникновении ошибок Microsoft Access Error 3302 имеет первостепенное значение для поиска причины проблем Microsoft Access и сообщения о них вMicrosoft Corporation за помощью.

Причины ошибок в файле Microsoft Access Error 3302

Проблемы Microsoft Access Error 3302 вызваны поврежденным или отсутствующим Microsoft Access Error 3302, недопустимыми ключами реестра, связанными с Microsoft Access, или вредоносным ПО.

В первую очередь, проблемы Microsoft Access Error 3302 создаются:

  • Недопустимый Microsoft Access Error 3302 или поврежденный раздел реестра.
  • Зазаражение вредоносными программами повредил файл Microsoft Access Error 3302.
  • Microsoft Access Error 3302 ошибочно удален или злонамеренно программным обеспечением, не связанным с приложением Microsoft Access.
  • Другая программа находится в конфликте с Microsoft Access и его общими файлами ссылок.
  • Поврежденная установка или загрузка Microsoft Access (Microsoft Access Error 3302).

Продукт Solvusoft

Загрузка
WinThruster 2023 — Проверьте свой компьютер на наличие ошибок.

Совместима с Windows 2000, XP, Vista, 7, 8, 10 и 11

Установить необязательные продукты — WinThruster (Solvusoft) | Лицензия | Политика защиты личных сведений | Условия | Удаление

Looks like no one’s replied in a while. To start the conversation again, simply

ask a new question.

hi, when I want to upload photos to a shared album, I get an error ‘PHPhotosErrorDomain error 3302’, and no photo is uploaded in the shared album. Kindly assist.

Posted on Jul 14, 2022 1:47 AM

Similar questions

  • photo won’t load to shared album
    Created a shared library, but .jpeg and .jpg photos will not load when dropped.

    212
    4

  • Shared Album not loading photos
    My shared album isn’t loading the photos, and when I click on them they are just gray squares. How do I make them load?

    926
    1

  • Can’t upload photos to shared cloud album
    Dear folks,

    All the time I try to upload photos to the shared cloud album I created, the system starts to prepare it and then it crashes.

    I’ve uploaded about 500 photos to this album already step by step, sending 20-50 photos per each upload, but now it goes down even when I try to upload 5+ photos.

    Please advise?

    Thank you.

    156
    1

4 replies

Jul 14, 2022 1:53 PM in response to baba masele

Hi

Are you able to open these images in edit mode?

Do you use iCloud photos with optimise mac storage selected?

Jul 15, 2022 5:48 AM in response to baba masele

Once you have opened an image in edit mode, are you then able to add it to the shared album?

Jul 15, 2022 6:22 AM in response to TonyCollinet

hi, if I go to Add photos in that album, I can add photos. But, if I select a person in people’s album, and chose to add that person in the shared album (named after that person), I get that error. Basically, I have created a shared album of my son called, Samuel, and I want to put all of Samuel’s photos in the shared album. It’s not working.

Uploading photos to shared album

При попытке сохранить файл записи экрана на моем устройстве, например:

PHPhotoLibrary.shared().performChanges({() -> Void in
                    PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: url)
                }, completionHandler: { (_, error) -> Void in
                    if let error = error {
                        self.showAlert(title: .saveFailed, message: error.localizedDescription)
                        return
                    }
                    do {
                        try FileManager.default.removeItem(at: url)
                        self.showAlert(title: .saved) {
                            self.dismissSelf()
                        }
                    } catch let error {
                        print(error)
                    }
                })

Иногда вылетает с ошибкой:

Domain=PHPhotosErrorDomain Code=3302

Что означает:

case invalidResource = 3302 // Asset resource validation failed

Хотя иногда это удается. Кто-нибудь знает, что означает ошибка invalidResource ??

1 ответ

В моем случае URL-адрес требует расширения файла, например. .gif.


0

hstdt
15 Ноя 2022 в 11:29

I am processing an H264 encoded video stream from a non-apple IoT device. I want to record bits of this video stream.

I’m getting an error when I try to save to the photo gallery:

The operation couldn’t be completed. (PHPhotosErrorDomain error 3302.)

My Code, let me know if I need to share more:

  private func beginRecording() {
    self.handlePhotoLibraryAuth()
    self.createFilePath()
    guard let videoOutputURL = self.outputURL,
       let vidWriter = try? AVAssetWriter(outputURL: videoOutputURL, fileType: AVFileType.mp4),
       self.formatDesc != nil else {
         print("Warning: No Format For Video")
         return
       }
    let vidInput = AVAssetWriterInput(mediaType: AVMediaType.video, outputSettings: nil, sourceFormatHint: self.formatDesc)
    guard vidWriter.canAdd(vidInput) else {
      print("Error: Cant add video writer input")
      return
    }
     
    let sourcePixelBufferAttributes = [
      kCVPixelBufferPixelFormatTypeKey as String: NSNumber(value: kCVPixelFormatType_32ARGB),
      kCVPixelBufferWidthKey as String: "1280",
      kCVPixelBufferHeightKey as String: "720"] as [String : Any]
     
    self.videoWriterInputPixelBufferAdaptor = AVAssetWriterInputPixelBufferAdaptor(
      assetWriterInput: vidInput,
      sourcePixelBufferAttributes: sourcePixelBufferAttributes)
    vidInput.expectsMediaDataInRealTime = true
    vidWriter.add(vidInput)
    guard vidWriter.startWriting() else {
      print("Error: Cant write with vid writer")
      return
    }
    vidWriter.startSession(atSourceTime: CMTimeMake(value: self.videoFrameCounter, timescale: self.videoFPS))
    self.videoWriter = vidWriter
    self.videoWriterInput = vidInput
    print("Recording Video Stream")
  }

Save the Video

  private func saveRecordingToPhotoLibrary() {
    let fileManager = FileManager.default
    guard fileManager.fileExists(atPath: self.path) else {
      print("Error: The file: \(self.path) not exists, so cannot move this file camera roll")
      return
    }
    print("The file: \(self.path) has been save into documents folder, and is ready to be moved to camera roll")
    PHPhotoLibrary.shared().performChanges({
      PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: URL(fileURLWithPath: self.path))
    }) { completed, error in
      guard completed else {
        print ("Error: Cannot move the video \(self.path) to camera roll, error: \(String(describing: error?.localizedDescription))")
        return
      }
      print("Video \(self.path) has been moved to camera roll")
    }
  }

 When Recording ends we save the video

  private func endRecording() {
    guard let vidInput = videoWriterInput, let vidWriter = videoWriter else {
      print("Error, no video writer or video input")
      return
    }
    vidInput.markAsFinished()
    if !vidInput.isReadyForMoreMediaData {
      vidWriter.finishWriting {
        print("Finished Recording")
        guard vidWriter.status == .completed else {
          print("Warning: The Video Writer status is not completed, status: \(vidWriter.status.rawValue)")
          print(vidWriter.error.debugDescription)
          return
        }
        print("VideoWriter status is completed")
        self.saveRecordingToPhotoLibrary()
      }
    }
  }

Понравилась статья? Поделить с друзьями:
  • Ошибка 33h ошибка передачи тега 1227
  • Ошибка 3304 фольксваген т5
  • Ошибка 33h ошибка передачи тега 1197
  • Ошибка 3303 ман тгс
  • Ошибка 33h ошибка передачи тега 1162