feat: 998: Add support for Apple ProRes decode SDK on Linux and Windows#1186
Open
dpmacri wants to merge 6 commits intoAcademySoftwareFoundation:mainfrom
Open
feat: 998: Add support for Apple ProRes decode SDK on Linux and Windows#1186dpmacri wants to merge 6 commits intoAcademySoftwareFoundation:mainfrom
dpmacri wants to merge 6 commits intoAcademySoftwareFoundation:mainfrom
Conversation
7c8ab37 to
31f62e4
Compare
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>
7fe54c6 to
c08df02
Compare
ORV_PREF_GLOBAL_PRORES_DECODER_THREADS to RV_PREF_GLOBAL_PRORES_DECODER_THREADS Signed-off-by: Dean P. Macri <dean.p.macri@gmail.com>
ef8ae5d to
f4eb786
Compare
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); | ||
| } |
Contributor
There was a problem hiding this comment.
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); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thervcfgcommand.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.