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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:09:42+00:00 2026-06-13T08:09:42+00:00

So I have an app that lets a user record a video or pick

  • 0

So I have an app that lets a user record a video or pick a video from their photo library, then upload the video to the server. After recording the video, I get the asset’s URL.

I try to set the NSData to the assetURL with the following code:

NSString *vidString =[NSString stringWithFormat:@"%@",savedVideoURL];
NSURL *vidURL = [NSURL URLWithString:vidString];
NSData *videoData = [NSData dataWithContentsOfURL:vidURL];

savedVideoURL is the asset URL gained during recording. The asset URL looks something like this: assets-library://asset/asset.MOV?id=6EB7A04D-3DF8-44E5-A6D8-FD98461AE75E&ext=MOV

When I try to set the NSData to that url, NSData is still equal to nil afterwards.

I could not get the following solution to work: Get video NSData from ALAsset url iOS

Does anyone else know a method of setting the NSData to that asset’s URL?

Thanks 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-06-13T08:09:42+00:00Added an answer on June 13, 2026 at 8:09 am

    Don’t forget to Import : AssetsLibrary/ALAssetRepresentation.h

    and code:

     ALAssetsLibrary *assetLibrary=[[ALAssetsLibrary alloc] init];
        [assetLibrary assetForURL:YOURURL resultBlock:^(ALAsset *asset) // substitute YOURURL with your url of video
        {
            ALAssetRepresentation *rep = [asset defaultRepresentation];
            Byte *buffer = (Byte*)malloc(rep.size);
            NSUInteger buffered = [rep getBytes:buffer fromOffset:0.0 length:rep.size error:nil];
            NSData *data = [NSData dataWithBytesNoCopy:buffer length:buffered freeWhenDone:YES];//this is NSData may be what you want
            [data writeToFile:photoFile atomically:YES]; //you can remove this if only nsdata needed
        } 
        failureBlock:^(NSError *err) {
            NSLog(@"Error: %@",[err localizedDescription]);
        }];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that lets user record their own audio. By now I'm
I currently have an iPhone app that lets the users take video, upload it
I have a Django app that lets a user upload a file and does
I have an activity that lets a user upload a photo to the web
I have an app that lets the user interact with several forms. I can
I have an app that contains several activities...so lets say user is navigating activity
Lets say you have a web app related Android app that requires the user
I have a simple catalogue app that lets users download product data from an
I have been asked to build an app that lets the user scroll massive
I'm working on an app for the ipad 2 that lets the user record

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.