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

lavc/videotoolboxenc: add ProRes support #378

Merged
merged 25 commits into from Dec 23, 2021
Merged

Conversation

rcombs
Copy link
Contributor

@rcombs rcombs commented Dec 17, 2021

Also includes a variety of infrastructural improvements in the VideoToolbox encoder, and some format support improvements in swscale.

@rcombs rcombs force-pushed the proresenc branch 4 times, most recently from 5236e36 to c88ebe0 Compare December 18, 2021 12:47
libavcodec/videotoolboxenc.c Outdated Show resolved Hide resolved
libavcodec/videotoolboxenc.c Outdated Show resolved Hide resolved
libavcodec/videotoolboxenc.c Outdated Show resolved Hide resolved
@rcombs
Copy link
Contributor Author

rcombs commented Dec 21, 2021

@kernrj I re-pushed with your comments addressed. There are also several additional commits in the branch now; sorry, I'm just expecting them all to ultimately land at around the same time.

Fixes support for alpha in hardware input frames
No longer requires per-format switch cases.

The frame==0 path was unused (and would've crashed anyway).
This avoids making terminal config changes that may not be reverted properly
during parallel testing.
Also fixes symbol lookup errors on older macOS when built with a newer SDK,
introduced in 6cab520
VideoToolbox internally sets all the colorspace parameters to BT709,
regardless of what the bitstream actually indicates, so we need to
replace that with what we've parsed.
These are all set by AV_OPT_TYPE_INT or AV_OPT_TYPE_BOOL; the only reason
they worked before was that this is only used on little-endian.
On some encoders, this defaults to true, which can result in encode speed
being _limited_ to only slightly above realtime (as a power-saving measure),
so we need a way to disable it.
We call this OBJCFLAGS in help text, but common.mak looks for OBJCCFLAGS.
Apparently on some OS and Xcode versions this can select an iOS SDK,
which in turn may fail on the affected versions.
Apparently Metal.framework is included with the command line tools
(and thus may be present without Xcode), but the Metal compiler is only
included as part of Xcode.
- Ensure the yadif .metal compiles when targeting any Metal runtime version
- Use some preprocessor awkwardness to ensure Core Video's Metal-specific
  functionality is exposed regardless of our deployment target (this works
  around what seems to be an SDK header bug, filed as FB9816002)
- Ensure all direct references to Metal functions and classes are gated
  behind runtime version checks (this satisfies clang's deployment-target
  violation warnings provided by -Wunguarded-availability).
@TimothyGu
Copy link
Member

TimothyGu commented Dec 23, 2021

(To be sure, I didn't merge this PR on GitHub or otherwise. But I maintain the FFmpeg/FFmpeg mirror, and it appears that the patches have been applied upstream with the same commit hashes, so GitHub thought it was me who merged it.)

@rcombs
Copy link
Contributor Author

rcombs commented Dec 23, 2021

Probably because your account pushed the commits to ffmpeg/ffmpeg.

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