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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:58:47+00:00 2026-05-24T04:58:47+00:00

I’m pulling all of the video assets from ALAssetsLibrary (Basically everything that’s being recorded

  • 0

I’m pulling all of the video assets from ALAssetsLibrary (Basically everything that’s being recorded from the native camera app). I am then running an enumeration on each video asset that does this to each video:

 // The end of the enumeration is signaled by asset == nil.
           if (alAsset) {

                 //Get the URL location of the video
               ALAssetRepresentation *representation = [alAsset defaultRepresentation];
               NSURL *url = [representation url];

                 //Create an AVAsset from the given URL
               NSDictionary *asset_options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:AVURLAssetPreferPreciseDurationAndTimingKey];
               AVAsset *avAsset = [[AVURLAsset alloc] initWithURL:url options:asset_options];//[AVURLAsset URLAssetWithURL:url options:asset_options];

               //Here is the problem
               NSLog([NSString stringWithFormat:@"%i", [avAsset.tracks count]]);
               NSLog([NSString stringWithFormat:@"%f", CMTimeGetSeconds(avAsset.duration)]);
           }

NSLog is reporting that the AVAsset that I’ve gotten from my ALAsset has 0 tracks, and has a duration of 0.0 seconds. I checked the url, and it’s “assets-library://asset/asset.MOV?id=9F482CF8-B4F6-40C2-A687-0D05F5F25529&ext=MOV” which seems correct. I know alAsset is actually a video, and the correct video, because I’ve displayed alAsset.thumbnail, and it’s shown the correct thumbnail for the video.

All this leads me to believe there’s something going wrong in the initialization for avAsset, but for the life of me, I can’t figure out what’s going wrong. Can anyone help me?

Update:

I think i’ve confirmed that the url being given to me by ALAssetRepresentation is faulty, which is weird because it gives me the correct thumbnail. I added this code in:

NSLog([NSString stringWithFormat:@"%i", [url checkResourceIsReachableAndReturnError:&error]]);
NSLog([NSString stringWithFormat:@"%@", error]);

It gives me this:

0
Error Domain=NSCocoaErrorDomain Code=4 "The operation couldn’t be completed. (Cocoa error 4.)" UserInfo=0x19df60 {}

I’m still not sure what would cause that. The only thing I’m noticing is the url, which is “assets-library://asset/asset.MOV?id=9F482CF8-B4F6-40C2-A687-0D05F5F25529&ext=MOV” is different from what I’ve seen as I’ve been searching around for this. The one i’ve seen elsewhere looks more like “assets-library://asset/asset.MOV?id=1000000394&ext=MOV”, with a number instead of an alphanumeric, dash separated name.

If it helps, I’m using XCode 4.2 Beta, and iOS5. Please let me know if you can think of anything. Thanks.

  • 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-24T04:58:49+00:00Added an answer on May 24, 2026 at 4:58 am

    Okay, looks like it was a bug in the iOS5 beta v1. I upgraded to the newest and it worked. Thanks to those who took a look at my question.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Let's say I'm outputting a post title and in our database, it's Hello Y’all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into

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.