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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:10:49+00:00 2026-05-31T14:10:49+00:00

I would like to, depending on the device and the settings in my application,

  • 0

I would like to, depending on the device and the settings in my application, transcode a video to a specific video format. For an example, if the user has an iPhone 4S and chooses medium settings in my application I would like to convert the video to 540p before I start processing. If he chooses high then I would like to transcode to 720p.

I could read the video frame by frame, resize and save to disc but this does not seem very effective. What would be the easiest and fastest way to transcode a video that I can feed to my video processing libraries?

I have tried using the videoQuality settings on my UIImagePickerController but seems like it is not working as even when I set it to UIImagePickerControllerQualityTypeIFrame960x540 my video comes out as 720p (640×480 is working but I need to be more granular).

  • 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-31T14:10:51+00:00Added an answer on May 31, 2026 at 2:10 pm

    You might want to look at AVAssetExportSession, which makes it reasonably simple to re-encode videos. I think it’s also hardware-supported when possible like the rest of AVFoundation:

    https://developer.apple.com/library/ios/#DOCUMENTATION/AudioVideo/Conceptual/AVFoundationPG/Articles/01_UsingAssets.html

    Note that it will never make the video larger than it already is, so you aren’t guaranteed to get the output size you request. The following code might be a start for what you want, assuming you have an instance of ALAsset:

    - (void)transcodeLibraryVideo:(ALAsset *)libraryAsset 
            toURL:(NSURL *)fileURL 
            withQuality:(NSString *quality) {
      // get a video asset for the original video file
      AVAsset *asset = [AVAsset assetWithURL:
        [NSURL URLWithString:
          [NSString stringWithFormat:@"%@", 
            [[libraryAsset defaultRepresentation] url]]]];
      // see if it's possible to export at the requested quality
      NSArray *compatiblePresets = [AVAssetExportSession 
        exportPresetsCompatibleWithAsset:asset];
      if ([compatiblePresets containsObject:quality]) {
        // set up the export
        AVAssetExportSession *exportSession = [[AVAssetExportSession alloc]
          initWithAsset:asset presetName:quality];
        exportSession.outputURL = fileURL;
        exportSession.outputFileType = AVFileTypeQuickTimeMovie;
        // run the export
        [exportSession exportAsynchronouslyWithCompletionHandler:^{
          switch ([exportSession status]) {
            case AVAssetExportSessionStatusFailed:
                //TODO: warn of failure
                break;
            case AVAssetExportSessionStatusCancelled:
                //TODO: warn of cancellation
                break;
            default:
                //TODO: do whatever is next
                break;
          }
          [exportSession release];
        }];
      }
      else {
        //TODO: warn that the requested quality is not available
      }
    }
    

    You would want to pass a quality of AVAssetExportPreset960x540 for 540p and AVAssetExportPreset1280x720 for 720p, for example.

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

Sidebar

Related Questions

I would like to handle requests differently depending upon the MIME type. For example,
I would like to include specific page depending upon button clicked. As far h:commandButton
I would like to base my Spring Security configuration depending on the user's context
I would like to include a different file depending on the version of GCC.
I would like to dynamically hide a button in one of my views depending
I would like to serve a different content from a single URL depending on
I would like to define a constant (like the admin-email-adress) depending on the environment.
Hy there I would like to have three apps depending, which are based on
I would like to extract the data groups from the PHP arrays depending on
I would like to select multiple worksheet depending on the userform checkboxes status and

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.