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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:53:48+00:00 2026-06-10T06:53:48+00:00

For extracting the RAW image buffer from an uncompressed v210 (with pixel format kCVPixelFormatType_422YpCbCr10)

  • 0

For extracting the RAW image buffer from an uncompressed v210 (with pixel format kCVPixelFormatType_422YpCbCr10) I tried to follow this great post:
Reading samples via AVAssetReader

The problem is, that when it comes to startReading of my assetReader I got an AVAssetReaderStatusFailed (with setting NSMutableDictionary object kCVPixelBufferPixelFormatTypeKey for the output settings to kCVPixelFormatType_422YpCbCr10). If I leave the outputSettings be nil, it parses each frame, but the CMSampleBufferRef buffers are empty.

I tried lots of the pixel formats such as

  • kCVPixelFormatType_422YpCbCr10
  • kCVPixelFormatType_422YpCbCr8
  • kCVPixelFormatType_422YpCbCr16
  • kCVPixelFormatType_422YpCbCr8_yuvs
  • kCVPixelFormatType_422YpCbCr8FullRange
  • kCVPixelFormatType_422YpCbCr_4A_8BiPlanar

but none of them work.

What am I doing wrong?

Any comments welcome…

Here is my code:

/* construct an AVAssetReader based on an file based URL */
NSError *error=[[NSError alloc]init];
NSString *filePathString=[[NSString alloc]
                          initWithString:@"/Users/johann/Raw12bit.mov"];

NSURL *movieUrl=[[NSURL alloc] initFileURLWithPath:filePathString];
AVURLAsset *movieAsset=[[AVURLAsset alloc] initWithURL:movieUrl options:nil]; 

/* determine image dimensions of images stored in movie asset */
CGSize size=[movieAsset naturalSize];  
NSLog(@"movie asset natual size: size.width=%f size.height=%f", 
      size.width, size.height);

/* allocate assetReader */
AVAssetReader *assetReader=[[AVAssetReader alloc] initWithAsset:movieAsset
                                                          error:&error];

/* get video track(s) from movie asset */
NSArray *videoTracks=[movieAsset tracksWithMediaType:AVMediaTypeVideo];

/* get first video track, if there is any */
AVAssetTrack *videoTrack0=[videoTracks objectAtIndex:0];

/* set the desired video frame format into attribute dictionary */
NSMutableDictionary* dictionary=[NSDictionary dictionaryWithObjectsAndKeys:
  [NSNumber numberWithInt:kCVPixelFormatType_422YpCbCr10], 
  (NSString*)kCVPixelBufferPixelFormatTypeKey,
  nil];

/* construct the actual track output and add it to the asset reader */
AVAssetReaderTrackOutput* assetReaderOutput=[[AVAssetReaderTrackOutput alloc] 
                                             initWithTrack:videoTrack0 
                                             outputSettings:dictionary]; //nil or dictionary
/* main parser loop */
NSInteger i=0;
if([assetReader canAddOutput:assetReaderOutput]){
  [assetReader addOutput:assetReaderOutput];

  NSLog(@"asset added to output.");

  /* start asset reader */
  if([assetReader startReading]==YES){
    /* read off the samples */
    CMSampleBufferRef buffer;
    while([assetReader status]==AVAssetReaderStatusReading){
      buffer=[assetReaderOutput copyNextSampleBuffer];
      i++;
      NSLog(@"decoding frame #%ld done.", i);
    }
  }
  else {
    NSLog(@"could not start reading asset.");
    NSLog(@"reader status: %ld", [assetReader status]);
  }
}
else {
  NSLog(@"could not add asset to output.");
}

Best Regards,
Johann

  • 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-10T06:53:49+00:00Added an answer on June 10, 2026 at 6:53 am

    Try kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange, it worked fine for me.

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

Sidebar

Related Questions

I'm extracting files from zip and rar archives into raw buffers. I created the
struggle extracting necessary data from this complex json stored inside php variable. Via php
I'm struggle extracting necessary data from this json stored inside php variable. Not yet
When extracting data from a list this way line[0:3], line[3][:2], line[3][2:] I receive an
I am extracting some functionality from an existing program into a separate library. This
Im Extracting Data from NSMuableDictionary to NSString and try compering to String like this:
I'm extracting information from a webpage in Swedish. This page is using characters like:
On extracting some html from a web page, I have some elements containing text
I'm extracting the min from a vector. Say vector = [0, inf, inf, inf];
I'm working on extracting data from a SQL Server database with a latin_1 character

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.