Post

Replies

Boosts

Views

Activity

AVAssetExportSession fails part way thru for long videos
as in the above note, shorter videos, say, less than 1 hour playing time seem to export ok. this is just a time clip operation we are doing not a composition. but when we put videos longer than an hour and try to clip them to an hour, the export fails part way thru we can see the .progress property proceeding then we get the mysterious unknown error code: An unknown error occurred (-12551) as noted below in our console output apple any hints besides unknown? surely your code knows why it failed. why not tell us?! the "code = " listed below is the .status which shows as 4 waiting for trimmed movie file save 1 progress = 0.692948 2021-03-08 14:55:52.702278-0500 KargoCamera[1598:154227] Export failed: The operation could not be completed code = 4 2021-03-08 14:55:52.702412-0500 KargoCamera[1598:154227] Export recovidea: (null) 2021-03-08 14:55:52.702507-0500 KargoCamera[1598:154227] Export reason: An unknown error occurred (-12551)
2
0
853
Apr ’21
hdr dolby vision video color correction to 8 bit still images
Hey guys, tried to follow the super confusing doc on this, but no luck yet. https://developer.apple.com/av-foundation/Incorporating-HDR-video-with-Dolby-Vision-into-your-apps.pdf I have code that uses AVAssetReader and AVAssetReaderTrackOutput to directly pull frames from a video, but the colors are wrong for HDR dolby videos. Basically what I want is to extract frames from an HDR Dolby video as images and have those images not be the wrong color. Don't care if they are only 8 bit per color instead of 10 and all the all new stuff, just the closest that old fashioned 8 bit per color supports. I added the statement marked // added for dolby hdr per the above doc, (spread across several lines), no luck, still bad colors. Any hints of what I am missing? NSMutableDictionary* dictionary = [[NSMutableDictionary alloc] init];                                [dictionary setObject:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA] forKey:(NSString*)kCVPixelBufferPixelFormatTypeKey];                // added for dolby hdr                dictionary[AVVideoColorPropertiesKey] = @{                 AVVideoColorPrimariesKey: AVVideoColorPrimaries_ITU_R_709_2,                 AVVideoTransferFunctionKey: AVVideoTransferFunction_ITU_R_709_2,                 AVVideoYCbCrMatrixKey: AVVideoYCbCrMatrix_ITU_R_709_2                 };                                AVAssetReaderTrackOutput* asset_reader_output = [[AVAssetReaderTrackOutput alloc] initWithTrack:video_track outputSettings:dictionary];                                  [asset_reader addOutput:asset_reader_output]; // from here we get sample buffers like this CMSampleBufferRef buffer2 = [asset_reader_output copyNextSampleBuffer]; // then pixel buffer  CVPixelBufferRef inputPixelBuffer = CMSampleBufferGetImageBuffer(buffer2); // then a CIImage   CIImage* ciImage = [CIImage imageWithCVPixelBuffer:inputPixelBuffer]; // one vid frame then we use standard stuff to convert that to a CGImage/UIImage
2
0
2.1k
Mar ’23
set background color of [UIImage systemImageNamed: ... ]
hello all, any idea if you can set the background color of one of these new SFSymbol images? i tried this paletteColors: method, it seems to take only the first color and use it as the foreground color   UIImageSymbolConfiguration * config =         [UIImageSymbolConfiguration configurationWithPaletteColors:@[[UIColor blueColor], [UIColor redColor]]];     UIImage * confMatImageSel = [UIImage systemImageNamed:@"square.grid.2x2"             withConfiguration:config];
Topic: Design SubTopic: General Tags:
2
0
2.4k
Oct ’22