Skip to content

feat: 998: Add support for Apple ProRes decode SDK on Linux and Windows#1186

Open
dpmacri wants to merge 6 commits intoAcademySoftwareFoundation:mainfrom
dpmacri:AppleProRes_SDK_Support
Open

feat: 998: Add support for Apple ProRes decode SDK on Linux and Windows#1186
dpmacri wants to merge 6 commits intoAcademySoftwareFoundation:mainfrom
dpmacri:AppleProRes_SDK_Support

Conversation

@dpmacri
Copy link

@dpmacri dpmacri commented Mar 4, 2026

Linked issues

Fixes #998

Summarize your change.

This change enables support for building in ProRes decode using the ProRes SDK provided by Apple (get freely by e-mailing prores@apple.com). The SDK is used only on Linux and Windows and is enabled by adding:
-DRV_DEPS_APPLE_PRORES_SDK_ZIP_PATH='<full path to SDK .zip file>' and
-DRV_FFMPEG_NON_FREE_DECODERS_TO_ENABLE="prores" to the rvcfg command.

The FFMPEG bit is needed to enable FFMPEG to allow the file type. The decoding is then done by calling out to the SDK from within MovieFFMpeg.cpp file via small wrappers in the newly added AppleProRes.cpp/.h files.

Describe the reason for the change.

To provide official support for ProRes decode on Linux and Windows.

Describe what you have tested and on which operating system.

Tested ProRes 422 and 4444 playback on Linux (Ubuntu 2024.04.1 LTS) and Windows 11. Also verified that macOS, which doesn't use this path, still builds and functions correctly.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 4, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: dpmacri / name: Dean Macri (f4eb786)
  • ✅ login: dpmacri / name: dpmacri (2ffde98)

@dpmacri dpmacri force-pushed the AppleProRes_SDK_Support branch from 7c8ab37 to 31f62e4 Compare March 6, 2026 19:24
bernie-laberge and others added 2 commits March 6, 2026 11:31
AcademySoftwareFoundation#1185)

### Revert fix: Fix crashes when calling sourcesAtFrame when clearing

### Linked issues
NA

### Summarize your change.

Reverted this commit to fix regression:

AcademySoftwareFoundation@02a537b

### Describe the reason for the change.

The commit that is being reverted in this commit caused a regression.
The following errors when clearing an RV session:
```
ERROR: event = before-graph-view-change
ERROR: function = __lambdac96 (void; Event event)
ERROR: Exception Value: exception: "nil argument to function"
ERROR: event = after-graph-view-change
ERROR: function = __lambdadd8 (void; Event event)
ERROR: Exception Value: exception: "nil argument to function"
ERROR: event = graph-node-inputs-changed
ERROR: function = __lambdadd9 (void; Event event)
ERROR: Exception Value: exception: "nil argument to function"
Traceback (most recent call last):
 File "/private/var/folders/10/sd1gk1s527bfkdmmlbg7352c0000gn/T/AppTranslocation/919C640B-34AC-4B5F-A9AE-D30F60636CDB/d/RV.app/Contents/PlugIns/Python/source_setup.py", line 505, in checkForDisplayGroup
   if commands.nodeType(event.contents()) == "RVDisplayGroup":
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception: Exception thrown while calling commands.nodeType -- exception: "nil argument to function"
Traceback (most recent call last):
 File "/private/var/folders/10/sd1gk1s527bfkdmmlbg7352c0000gn/T/AppTranslocation/919C640B-34AC-4B5F-A9AE-D30F60636CDB/d/RV.app/Contents/PlugIns/Python/source_setup.py", line 505, in checkForDisplayGroup
   if commands.nodeType(event.contents()) == "RVDisplayGroup":
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception: Exception thrown while calling commands.nodeType -- exception: "nil argument to function"
```

### Describe what you have tested and on which operating system.
Successfully tested on macOS

### Add a list of changes, and note any that might need special
attention during the review.

### If possible, provide screenshots.

Signed-off-by: Bernard Laberge <bernard.laberge@autodesk.com>
Signed-off-by: Dean Macri <dean.p.macri@gmail.com>
This change enables support for building in ProRes decode using the
ProRes SDK provided by Apple (get freely by e-mailing prores@apple.com).
The SDK is used only on Linux and Windows and is enabled by adding
-DRV_DEPS_APPLE_PRORES_SDK_ZIP_PATH='<full path to SDK .zip file>' and
-DRV_FFMPEG_NON_FREE_DECODERS_TO_ENABLE="prores" to the rvcfg command.

The FFMPEG bit is needed to enable FFMPEG to allow the file type.  The
decoding is then done by calling out to the SDK from within
MovieFFMpeg.cpp file via small wrappers in the newly added
AppleProRes.cpp/.h files.

Tested on Linux (Ubuntu 2024.04.1 LTS) and Windows 11.  Also verified
that macOS, which doesn't use this path, still builds and functions
correctly.

Signed-off-by: Dean Macri <dean.p.macri@gmail.com>
@dpmacri dpmacri force-pushed the AppleProRes_SDK_Support branch from 7fe54c6 to c08df02 Compare March 6, 2026 19:31
dpmacri and others added 2 commits March 16, 2026 08:39
ORV_PREF_GLOBAL_PRORES_DECODER_THREADS to
RV_PREF_GLOBAL_PRORES_DECODER_THREADS

Signed-off-by: Dean P. Macri <dean.p.macri@gmail.com>
@dpmacri dpmacri force-pushed the AppleProRes_SDK_Support branch from ef8ae5d to f4eb786 Compare March 18, 2026 15:51
Comment on lines +115 to +122
// Now decode the frame
int bytesDecoded = PRDecodeFrame(prdecoder, videoPacket->data, videoPacket->size, &prpixbuf, kPRFullSize, 0);
if (bytesDecoded != videoPacket->size)
{
av_log(avctx, AV_LOG_ERROR, "Expected to decode %d bytes but decoded %d\n", videoPacket->size, bytesDecoded);
assert(0);
return AVERROR(EINVAL);
}
Copy link
Contributor

@cedrik-fuoco-adsk cedrik-fuoco-adsk Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dpmacri, I tried your branch with a media (ProRes 4444) and I got a lot of errors when loading the media:

...
ERROR: Expected to decode 5543936 bytes but decoded 5543305
ERROR: Expected to decode 5539840 bytes but decoded 5538668
ERROR: Expected to decode 5541888 bytes but decoded 5540534
ERROR: Expected to decode 5537792 bytes but decoded 5537523
ERROR: Expected to decode 5545984 bytes but decoded 5544803
ERROR: Expected to decode 5543936 bytes but decoded 5542725
ERROR: Expected to decode 5556224 bytes but decoded 5555950
...

My solution was the following changes:

Suggested change
// Now decode the frame
int bytesDecoded = PRDecodeFrame(prdecoder, videoPacket->data, videoPacket->size, &prpixbuf, kPRFullSize, 0);
if (bytesDecoded != videoPacket->size)
{
av_log(avctx, AV_LOG_ERROR, "Expected to decode %d bytes but decoded %d\n", videoPacket->size, bytesDecoded);
assert(0);
return AVERROR(EINVAL);
}
// Now decode the frame
// PRDecodeFrame returns the number of bytes consumed from the compressed
    // buffer, which may be less than videoPacket->size because the container
    // (MOV, MXF, MKV, etc.) can report a larger sample size than the actual
    // ProRes frame.  A negative return value indicates a decode error.
int bytesDecoded = PRDecodeFrame(prdecoder, videoPacket->data, videoPacket->size, &prpixbuf, kPRFullSize, 0);
if (bytesDecoded <= 0)
{
av_log(avctx, AV_LOG_ERROR, "PRDecodeFrame failed: returned %d (packet size %d)\n", bytesDecoded, videoPacket->size);
return AVERROR(EINVAL);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Apple ProRes decode SDK on Linux and Windows

3 participants