Post

Replies

Boosts

Views

Activity

Reply to NSImage from Video Data
I can point you in the right direction, i420 or YUV has 3 planes (or buffers), you're only decoding one, Not knowing how you obtained your initial buffer, I can't tell you how to get the rest. But once you have all three you have to combine them together, typically using a fragment shader
Topic: Media Technologies SubTopic: General Tags:
Oct ’21
Reply to NSImage from Video Data
I can point you in the right direction, i420 or YUV has 3 planes (or buffers), you're only decoding one, Not knowing how you obtained your initial buffer, I can't tell you how to get the rest. But once you have all three you have to combine them together, typically using a fragment shader
Topic: Media Technologies SubTopic: General Tags:
Oct ’21
Reply to macOS 12 beta | Updating metadata silently fails at file level
That shouldn't have been an answer, missed the comment button. Anyway, I have replicated the issue in a single test. For me the issue manifests itself in iOS 15, if I run the test on a device running ios 14, the test passes. Here is the full code for a test, you'll need to supply your own image and change a tag that exists for you: func testCGImageDestinationCopyImageSource() throws {     guard let imageURL = Bundle(for: self.classForCoder).url(forResource: "Image_000001", withExtension: "jpg") else {       XCTFail()       return     }     // Work with the image data     let originalData = try Data(contentsOf: imageURL)     // Create source from data     guard let imageSource = CGImageSourceCreateWithData(originalData as CFData, nil) else {       XCTFail()       return     }     guard let UTI: CFString = CGImageSourceGetType(imageSource) else {       XCTFail()       return     }     // Setup a new destination to copy data too     let imageData: CFMutableData = CFDataCreateMutable(nil, 0)     guard let destination = CGImageDestinationCreateWithData(imageData as CFMutableData, UTI, 1, nil) else {       XCTFail()       return     }     // Get the metadata     var mutableMetadata: CGMutableImageMetadata     if let imageMetadata = CGImageSourceCopyMetadataAtIndex(imageSource, 0, nil) {       mutableMetadata = CGImageMetadataCreateMutableCopy(imageMetadata) ?? CGImageMetadataCreateMutable()     } else {       mutableMetadata = CGImageMetadataCreateMutable()     }     // Inspect and check the old value     guard let tag = CGImageMetadataCopyTagMatchingImageProperty(mutableMetadata,                                   kCGImagePropertyExifDictionary,                                   kCGImagePropertyExifLensModel) else {       XCTFail()       return     }     guard let originalValue = CGImageMetadataTagCopyValue(tag) as? String else {       XCTFail()       return     }     XCTAssertEqual(originalValue, "iOS.0")     // Set a new value in the metadata     CGImageMetadataSetValueMatchingImageProperty(mutableMetadata,                            kCGImagePropertyExifDictionary,                            kCGImagePropertyExifLensModel, "iOS" as CFString)     // Ensure new value is set in the metadata     guard let newTag = CGImageMetadataCopyTagMatchingImageProperty(mutableMetadata,                                   kCGImagePropertyExifDictionary,                                   kCGImagePropertyExifLensModel) else {       XCTFail()       return     }     guard let newValue = CGImageMetadataTagCopyValue(newTag) as? String else {       XCTFail()       return     }     XCTAssertEqual(newValue, "iOS")     // Combine the new metadata with the original image     let options = [       kCGImageDestinationMetadata as String : mutableMetadata,       kCGImageDestinationMergeMetadata as String : true       ] as [String : Any]     guard CGImageDestinationCopyImageSource(destination, imageSource, options as CFDictionary, nil) else {       XCTFail()       return     }     // Create a new source from the copied to data     guard let newSource = CGImageSourceCreateWithData(imageData as CFData, nil) else {       XCTFail()       return     } // Get the metadata from the copied to data     var mutableMetadata2: CGMutableImageMetadata     if let imageMetadata2 = CGImageSourceCopyMetadataAtIndex(newSource, 0, nil) {       mutableMetadata2 = CGImageMetadataCreateMutableCopy(imageMetadata2) ?? CGImageMetadataCreateMutable()     } else {       mutableMetadata2 = CGImageMetadataCreateMutable()     }     // Inspect and check the value in the copied to data     guard let updatedTag = CGImageMetadataCopyTagMatchingImageProperty(mutableMetadata2,                                   kCGImagePropertyExifDictionary,                                   kCGImagePropertyExifLensModel) else {       XCTFail()       return     }     guard let updatedValue = CGImageMetadataTagCopyValue(updatedTag) as? String else {       XCTFail()       return     }     XCTAssertEqual(updatedValue, "iOS")   }
Topic: Media Technologies SubTopic: General Tags:
Sep ’21
Reply to Download container not success on iOS 17 / Xcode 15
This seems to work on XCode 16
Replies
Boosts
Views
Activity
Dec ’24
Reply to XCode 14.2 breaks with iOS 16.4
Really annoying to have to use a beta xcode for a released version of iOS
Replies
Boosts
Views
Activity
Mar ’23
Reply to iPhone has become completely inaccessible due to app install notification on Lock screen
We managed to restart the phone with the force restart (volume up, volume down, hold power button)
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to iPhone has become completely inaccessible due to app install notification on Lock screen
iOS version : 16.0.2(20A380)
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to App Store Connect won't let me manage my Testflight builds
I managed to fix the compliance by using the Connect app on an iPhone, but it's less than ideal for doing things like setting the test details, as all the details are on my laptop
Replies
Boosts
Views
Activity
Aug ’22
Reply to CGImageDestinationCopyImageSource no longer merges metadata on iOS 15
This test passes on iOS 15.1 so it seems it is fixed at that version The test still fails for iOS 15.0
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Crash on MTLDebugCommandBuffer lockPurgeableObjects in MacOS 12
Likely if the crash appears at random points in the code, you actually have a threading issue, and a background thread is crashing somewhere. I think a lot of AV Video code makes heavy use of multi threading.
Replies
Boosts
Views
Activity
Oct ’21
Reply to CGImageDestinationCopyImageSource no longer merges metadata on iOS 15
I submitted feedback : FB9660480 This is quite a serious issue for us, other frameworks to update metadata do not provide the facilities we need, and if this doesn't work, we'll have to redo our whole metadata editing pipeline with an external library
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to NSImage from Video Data
I can point you in the right direction, i420 or YUV has 3 planes (or buffers), you're only decoding one, Not knowing how you obtained your initial buffer, I can't tell you how to get the rest. But once you have all three you have to combine them together, typically using a fragment shader
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to NSImage from Video Data
I can point you in the right direction, i420 or YUV has 3 planes (or buffers), you're only decoding one, Not knowing how you obtained your initial buffer, I can't tell you how to get the rest. But once you have all three you have to combine them together, typically using a fragment shader
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to macOS 12 beta | Updating metadata silently fails at file level
That shouldn't have been an answer, missed the comment button. Anyway, I have replicated the issue in a single test. For me the issue manifests itself in iOS 15, if I run the test on a device running ios 14, the test passes. Here is the full code for a test, you'll need to supply your own image and change a tag that exists for you: func testCGImageDestinationCopyImageSource() throws {     guard let imageURL = Bundle(for: self.classForCoder).url(forResource: "Image_000001", withExtension: "jpg") else {       XCTFail()       return     }     // Work with the image data     let originalData = try Data(contentsOf: imageURL)     // Create source from data     guard let imageSource = CGImageSourceCreateWithData(originalData as CFData, nil) else {       XCTFail()       return     }     guard let UTI: CFString = CGImageSourceGetType(imageSource) else {       XCTFail()       return     }     // Setup a new destination to copy data too     let imageData: CFMutableData = CFDataCreateMutable(nil, 0)     guard let destination = CGImageDestinationCreateWithData(imageData as CFMutableData, UTI, 1, nil) else {       XCTFail()       return     }     // Get the metadata     var mutableMetadata: CGMutableImageMetadata     if let imageMetadata = CGImageSourceCopyMetadataAtIndex(imageSource, 0, nil) {       mutableMetadata = CGImageMetadataCreateMutableCopy(imageMetadata) ?? CGImageMetadataCreateMutable()     } else {       mutableMetadata = CGImageMetadataCreateMutable()     }     // Inspect and check the old value     guard let tag = CGImageMetadataCopyTagMatchingImageProperty(mutableMetadata,                                   kCGImagePropertyExifDictionary,                                   kCGImagePropertyExifLensModel) else {       XCTFail()       return     }     guard let originalValue = CGImageMetadataTagCopyValue(tag) as? String else {       XCTFail()       return     }     XCTAssertEqual(originalValue, "iOS.0")     // Set a new value in the metadata     CGImageMetadataSetValueMatchingImageProperty(mutableMetadata,                            kCGImagePropertyExifDictionary,                            kCGImagePropertyExifLensModel, "iOS" as CFString)     // Ensure new value is set in the metadata     guard let newTag = CGImageMetadataCopyTagMatchingImageProperty(mutableMetadata,                                   kCGImagePropertyExifDictionary,                                   kCGImagePropertyExifLensModel) else {       XCTFail()       return     }     guard let newValue = CGImageMetadataTagCopyValue(newTag) as? String else {       XCTFail()       return     }     XCTAssertEqual(newValue, "iOS")     // Combine the new metadata with the original image     let options = [       kCGImageDestinationMetadata as String : mutableMetadata,       kCGImageDestinationMergeMetadata as String : true       ] as [String : Any]     guard CGImageDestinationCopyImageSource(destination, imageSource, options as CFDictionary, nil) else {       XCTFail()       return     }     // Create a new source from the copied to data     guard let newSource = CGImageSourceCreateWithData(imageData as CFData, nil) else {       XCTFail()       return     } // Get the metadata from the copied to data     var mutableMetadata2: CGMutableImageMetadata     if let imageMetadata2 = CGImageSourceCopyMetadataAtIndex(newSource, 0, nil) {       mutableMetadata2 = CGImageMetadataCreateMutableCopy(imageMetadata2) ?? CGImageMetadataCreateMutable()     } else {       mutableMetadata2 = CGImageMetadataCreateMutable()     }     // Inspect and check the value in the copied to data     guard let updatedTag = CGImageMetadataCopyTagMatchingImageProperty(mutableMetadata2,                                   kCGImagePropertyExifDictionary,                                   kCGImagePropertyExifLensModel) else {       XCTFail()       return     }     guard let updatedValue = CGImageMetadataTagCopyValue(updatedTag) as? String else {       XCTFail()       return     }     XCTAssertEqual(updatedValue, "iOS")   }
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to macOS 12 beta | Updating metadata silently fails at file level
I think I'm also running into this problem but on iOS 15. I use CGImageDestinationCopyImageSource to update some metadata. I ran an XCode test to make sure it was correctly set, but since I updated to XCode 13 and iOS 15, the test fails and the metadata is not updated in the file
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’21