Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue May 12, 2024 · 1 comment

Comments

@joema4
Copy link

joema4 commented May 12, 2024

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:

  • 2022 M1 Ultra Mac Studio (128GB RAM, 8TB SSD)
  • macOS Sonoma 14.4.1
  • Final Cut Pro 10.7.1
  • Also tested: 2019 i9 MacBook Pro 16, 2023 M2 Pro Mac Mini, both running Sonoma 14.4.1

OTHER STEPS TAKEN:

  • Did binary diff on video files starting with name "QT4444". They are the same except encoded using two different versions of FFmpeg. No apparent differences that would account for the behavior.
  • Examined metadata of "good" and "bad" QT4444 video files using FFmpeg, FFprobe, ExifTool. No obvious differences at metadata level.
  • Ran FCP under XCode and set breakpoints to find FFImageRepFFPixelBuffer during playback. Nothing obvious.

TO DO:

  • Provide various statically-built versions of FFmpeg in both Intel and Apple Silicon versions
  • Provide instructions and video files for encoding ProRes 4444 files using FFmpeg
  • Provide instructions for using the self-encoded files for testing alpha-channel transparency issue

QCTools_Datascope_PR4444_AlphaChannel

@joema4
Copy link
Author

joema4 commented May 16, 2024

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:

  • Obtain ProRes 4444 files generated by Apple-approved cameras and recorders (DJI Ronin 4D, Atomos Ninja V, Atomos Shogun 7) and test those for both alpha-channel transparency and ProResHW errors using both FCP and Resolve Studio. Purpose: to inspect if any ProRes 4444 files generated by non-Apple (but approved) hardware devices encounter problems on Sonoma 14.4.1 and 14.5 on Apple Silicon.

  • Transcode "known good" ProRes source files to ProRes 4444 using EditReady 24.2, Resolve Studio 18.6.6 and Premiere Pro 24.3.0 on Sonoma 14.4.1 and 14.5 on Apple Silicon. Purpose: inspect if any ProRes 4444 files generated by non-Apple (but approved) software create files that cause problems on Sonoma 14.4.1 and 14.5 on Apple Silicon.

  • Devise and run stress tests to investigate if the ProResHW errors caused by FFmpeg-generated ProRes 4444 files on Sonoma 14.4.1 and 14.5 on Apple Silicon cascade to more serious problems such as performance degradation, instability, etc. Obtain XCode Instruments profiles during those tests and compare to normal baseline runs. Purpose: determine if the behavior has more serious ramifications than seemingly benign errors.

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

No branches or pull requests

2 participants