CommandPost / FCPCafe

FCP Cafe Website
https://fcp.cafe
MIT License
26 stars 15 forks source link

FCP shows FFmpeg-generated ProRes 4444 alpha as opaque on Sonoma 14.4.1 Apple Silicon; Prores decode errors in log #359

Open joema4 opened 1 month ago

joema4 commented 1 month ago

This not an FCP bug and maybe not a MacOS bug. Filing this to avoid confusion because it may appear like an FCP or MacOS bug.


DESCRIPTION:

Starting with Sonoma 14.4.0 or 14.4.1 on Apple Silicon, FCP 10.7.1 will incorrectly show a transparent ProRes 4444 alpha channel as opaque if the file was generated by certain versions of FFmpeg and the associated Lavf library. Resolve Studio 18.6.6 and Premiere Pro 24.3.0 behave likewise. This does not happen on Intel.

FCP playback will also generate ProRes HW errors in the MacOS system log. There is no user-facing error. These do not appear in Console but can be seen using the terminal "log show" command. Example:

2024-05-11 10:00:27.683661-0500 0x2db Error 0x0 0 0 kernel: (AppleProResHW) ERROR: AppleProResHW (0x13e358d7): processDecodeFrameDone(): HW error decSatus=6 status0=0x7f043000 statusCode=63 status2=0x1

FFmpeg versions tested and behavior (Note: ALL cause ProRes HW decode errors, even if alpha transparency is OK)

FFmpeg 7.01, Lavf61.1.100 - transparent alpha channel OK FFmpeg 7.00, Lavf61.3.103 - transparent alpha channel OK FFmpeg 6.10, Lavf60.16.100 - transparent alpha channel shows as opaque FFmpeg 5.??, Lavf58.43.100 - transparent alpha channel shows as opaque

This seems an interpretation problem due to something in the FFmpeg-encoded file. I inspected the alpha-channel values in the encoded file using the QCTools datascope and they had transparent values (ie close to 0x0000) but appeared as opaque in FCP. See attached datascope screen shot.


HOW TO REPRODUCE:

(1) Use an Apple Silicon machine running Sonoma 14.4.1.

(2) Attached are four 1080p ProRes 4444 files with a transparent alpha channel. Each one is generated by one of the above four versions of FFmpeg and has the above-stated behaviors (version numbers also in the filenames).

Files: https://www.dropbox.com/scl/fo/l6388h0co0q8gwvx1ojcm/AFHdiZwt6wp5MmSKSmT6vEc?rlkey=rvf3kedtlxek4w9gf7ng7lloe&dl=0

(3) Import the four ProRes 4444 files to FCP.

(4) Add each file to a project timeline.

(5) Add beneath each clip a built-in FCP generator to observe if alpha-channel transparency exists.

(6) Examine the MacOS system log using the terminal "log show" command. Example syntax (do within 10 sec of FCP playback):

sudo log show --last 10s > ~/Documents/LogShowOutput_10s.txt

(7) The log is verbose so use BBEdit or similar to filter through the file. Look for the string "AppleProResHW".


SCREENSHOTS:

Filename: QCTools_Datascope_PR4444_AlphaChannel.jpg. QCTools Datascope showing alpha-channel value of 0x0060 (should be nearly transparent), but shows as opaque in FCP on MacOS Sonoma 14.4.1 Apple Silicon.


SPECS:


OTHER STEPS TAKEN:


TO DO:

QCTools_Datascope_PR4444_AlphaChannel

joema4 commented 1 month ago

Re-tested on MacOS Sonoma 14.5 M1 Ultra; no change. If using ProRes 4444 files generated by FFmpeg 7.01 using Lavf61.1.100 from a "known good" ProRes source file, the opaque alpha problem does not happen, but both FCP 10.7.1 and Resolve Studio 18.6.6 still get ProResHW decoding errors in the MacOS system log during playback of the FFmpeg-generated ProRes 4444 file, as shown by the terminal command "log show". Does not happen with those same versions on Intel. Whether there are other negative ramifications from the ProResHW errors (stability, performance, etc) is not currently known.

Comments on possible impact:

In the document "Apple ProRes and ProRes RAW Authorized Products", Apple clearly states that "Using any unauthorized implementation (such as the FFmpeg and derivative implementations) might lead to decoding errors, performance degradation, incompatibility, and instability." https://support.apple.com/en-us/118584

However, the above case was first seen when a customer used Ross Video XPression INcoder version 10.5, which is widely used throughout the broadcast TV industry: https://www.rossvideo.com/live-production/graphics/xpression/

Certain versions of XPression INcoder use FFmpeg to generate ProRes 4444 output. On Apple's above web page, it lists Ross Video XPression as an approved product, but my guess is that is (a) For the current version 11.5 product and (b) That approval does not include generating ProRes 4444 with FFmpeg.

Nonetheless it seems likely that FFmpeg-generated ProRes files are deeply intertwined throughout the post-production pipelines of various industries. Apparently, up until Sonoma 14.4.1 on Apple Silicon, those worked OK. Now they do not.

If FFmpeg is upgraded to version 7 and if the associated library to Lavf61.1.100 or later, the alpha channel behavior of ProRes 4444 files generated by that utility becomes normal as seen in FCP 10.7.1 and Resolve Studio 18.6.6 on Sonoma 14.4.1 and 14.5. But playback in FCP or Resolve Studio of those files still generates ProResHW decoding errors in the MacOS system log as shown by the terminal "log show" utility.

Other tests to run: