Post

Replies

Boosts

Views

Activity

Tone mapping SDR content for HDR composition
If you have two video segments, one HDR and one SDR, next to one another in a composition, the SDR one appears dark, since its max luminance will be lower than the max luminance of the HDR clip. iMovie handles this well by (reverse) tone mapping the SDR content to make it look HDR in an HDR composition. This is what I want to achieve. I've looked into algorithms to do this, and the best that I can find is the conversion from RGB to YCbCr described in Table 4 of BT.2020, followed by conversion method A (Section 4.2, table 4) of BT.2446-1. I have these implemented in a Core Image kernel, available at this repo. The issue that I'm seeing is that the colors are still much too hot, and while there are frames that appear close to properly tone mapped, it doesn't come close to the accuracy of iMovie's approach. If someone is an expert in colorimetry, etc., I'd really appreciate a breakdown of what I'm doing wrong here. To be specific: Assuming non-constant luminance for the YCbCr conversion Using a Metal Core Image kernel for the actual tone mapping The video composition uses Core Image filters directly The video composition is using BT.2020 colorimetry and the PQ transfer function. Below is a comparison of two screenshots, one using an unaltered HDR asset, and the other using the same asset transcoded to SDR with QuickTime, and reverse tone mapped to HDR for playback. Is there something I'm missing?
3
1
498
Mar ’25
Is Family Sharing included in Transaction.currentEntitlements?
We have a user that's shared screenshots indicating that they're the recipient of a subscription to our app through Family Sharing, but when we look for the transaction in Transaction.currentEntitlements there's nothing there, even after calling AppStore.sync. Should we expect to see a transaction in current entitlements? How can we determine whether it's our bug or Apple's?
1
0
357
Nov ’24
AVAssetReader init failure -- media services were reset
I work on a video editing app that composes multiple small video clips, sometimes hundreds or thousands. For one user in particular, attempting to export causes a failure 100% of the time. The failure occurs in the initialization of AVAssetReader, and is in the AVFoundationErrorDomain with code -11819 (AVErrorMediaServicesWereReset.) We've done everything we can think of, including quitting other running apps, enabling airplane mode, and even performing the flow on an identical device using the customer's data, and have had no luck pinning down the cause of the error. Does anyone have any suggestion for how we might go about debugging this? Getting ready to file a TSI but thought I should ask here first.
1
0
606
Sep ’24
Changing CIKernel sampler coord causes chaos
I feel like I'm missing something really simple. I've got the simplest possible CIKernel, it looks like this: extern "C" float4 Simple(coreimage::sampler s) { float2 current = s.coord(); float2 anotherCoord = float2(current.x + 1.0, current.y); float4 sample = s.sample(anotherCoord); // s.sample(current) works fine return sample; } It's (in my mind) incrementing the x position of the sampler by 1 and sampling the neighboring pixel. What I get in practice is a bunch of banded garbage (pictured below.) The sampler seems to be pretty much undocumented, so I have no idea whether I'm incrementing by the right amount to advance one pixel. The weird banding is still present if I clamp anootherCoord to s.extent() but it behaves normally if I sample s.coord() unchanged. I'm trying to write a box blur that samples / averages neighboring pixels and am completely blocked by this. What am I missing?
2
0
763
May ’24
How do subscription offer codes work for existing customers?
Say I have a customer with an active one-year subscription and want to create an offer code for 6 months at a reduced price that's available to all subscribers -- new, existing, and lapsed. If my customer with an active subscription uses the code, will the promotional period just occur at the end of their current active subscription period? I can't find this documented anywhere -- a link would be much appreciated.
1
1
1.2k
Jan ’23
How to generate mapping of ActorID to Peer in TicTacFish (Distributed Actors sample project)
In Apple's TicTacFish sample project, Step 3 provides an example of a LocalNetworkActorSystem based on Bonjour. At various points in the implementation, reference is made to building up a mapping from actor IDs to Connections/Peers, such that we can identify the correct connections to send calls and replies on (the sample project just broadcasts to all connections.) I've tried various approaches but can't get past the simple hurdle that: the methods required by DistributedActorSystem (e.g., SampleLocalNetworkActorSystem.remoteCall(on:target:invocation:throwing:returning:) do not allow for additional arguments, preventing me from passing along data about the originating connection that could be used to uniquely identify the peer the peer initialization happens separately from the relevant ActorID methods (e.g., SampleLocalNetworkActorSystem.resolve(id:as:), SampleLocalNetworkActorSystem.assignID(_:), SampleLocalNetworkActorSystem.actorReady(_:)) which prevents me from knowing which connection this actor initialization corresponds to. Has anyone figured out a way to get this to work?
0
0
916
Nov ’22