-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[ffmpeg] Add NVIDIA Codec feature for Windows and Linux #9171
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
Changes from 1 commit
30153ea
2804186
c56a092
ebb5481
5420690
955e86d
2bb5353
a61a143
92786a4
f542c5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| Source: ffnvcodec | ||
| Version: 9.1.23.0 | ||
| Homepage: https://github.com/FFmpeg/nv-codec-headers | ||
| Description: FFmpeg version of Nvidia Codec SDK headers. | ||
| Source: ffnvcodec | ||
| Version: 9.0.18.1 | ||
| Homepage: https://github.com/FFmpeg/nv-codec-headers | ||
| Description: FFmpeg version of Nvidia Codec SDK headers. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/usr/bin/bash | ||
| set -e | ||
| export PATH=/usr/bin:$PATH | ||
|
|
||
| #SOURCE_PATH="`cygpath "$1"`" | ||
| #CURRENT_PACKAGES_DIR="`cygpath "$2"`" | ||
| SOURCE_PATH="$1" | ||
| CURRENT_PACKAGES_DIR="$2" | ||
|
|
||
| echo "CURRENT_PACKAGES_DIR=${CURRENT_PACKAGES_DIR}" | ||
|
|
||
| pushd ${SOURCE_PATH} | ||
| make PREFIX=${CURRENT_PACKAGES_DIR} | ||
| make install PREFIX=${CURRENT_PACKAGES_DIR} | ||
| mkdir -p /usr/lib/pkgconfig | ||
| cp ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/ffnvcodec.pc /usr/lib/pkgconfig | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this copy? We are installing packages config in the packages dir for ffnvcodec and ffmpeg is getting it via
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm. This was a long time ago. It think the idea is as follows:
This last step is the reason why we copy the file to the root /usr/lib/pkgconfig Now, I guess that if we do away with this copy, we remove a potential build problem. I can think of a situation where the user would decide to purge/reset the msys environment. The ffnvcodec package would still be installed, but the ffmpeg build would fail because the .pc file is no longer in the msys environment. My question for you is: does vcpkg launch msys with the right PKG_CONFIG_PATH? if so, then yeah, I think we can remove these lines. I'll give it a try. I'll start with a fresh checkout, remove the offending lines, and try again. I'll let you know.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I ran into some problems, sorry for any confused back and forth email you may have received.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have submitted a workaround for the |
||
| popd | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * This copyright notice applies to this header file only: | ||
| * | ||
| * Copyright (c) 2010-2019 NVIDIA Corporation | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person | ||
| * obtaining a copy of this software and associated documentation | ||
| * files (the "Software"), to deal in the Software without | ||
| * restriction, including without limitation the rights to use, | ||
| * copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| * copies of the software, and to permit persons to whom the | ||
| * software is furnished to do so, subject to the following | ||
| * conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be | ||
| * included in all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
| * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
| * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
| * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| * OTHER DEALINGS IN THE SOFTWARE. | ||
| */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,50 @@ | ||
| # Header-only-library | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO FFmpeg/nv-codec-headers | ||
| REF n9.1.23.0 | ||
| SHA512 d9cb1ad496d971da31165e643c6c4f433561a856050503783051604f24ea5f9997859b05695632ea94ce9659966915789e6d7f7d536764804c9f673d1c8c63e4 | ||
| HEAD_REF master | ||
| ) | ||
|
|
||
| file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) | ||
|
|
||
| #Handle copyright | ||
| file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) | ||
| # Get nvcodec | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO FFmpeg/nv-codec-headers | ||
| REF n9.0.18.1 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We prefer to use commit id instead of tag name in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
| SHA512 4306ee3c6e72e9e3172b28c5e6166ec3fb9dfdc32578aebda0588afc682f56286dd6f616284c9892907cd413f57770be3662572207a36d6ac65c75a03d381f6f | ||
| HEAD_REF master | ||
| ) | ||
|
|
||
| # ==================================================== | ||
| # Install the pkgconfig info for the the `nvcodec` package | ||
|
marcbertola marked this conversation as resolved.
Outdated
|
||
| # ==================================================== | ||
| if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") | ||
| set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh) | ||
| vcpkg_acquire_msys(MSYS_ROOT PACKAGES make pkg-config) | ||
| set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) | ||
|
|
||
| message(STATUS "Building ${_csc_PROJECT_PATH} for Release") | ||
| file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) | ||
|
|
||
| # Build script parameters: | ||
| # source root | ||
| # root of where the package would be installed on a linux system (here this is the package dir) | ||
| vcpkg_execute_required_process( | ||
| COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}" | ||
| "${SOURCE_PATH}" # SOURCE DIR | ||
| "${CURRENT_PACKAGES_DIR}" # PACKAGE DIR | ||
| WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} | ||
| LOGNAME build-${TARGET_TRIPLET} | ||
| ) | ||
|
|
||
| else() | ||
| FIND_PROGRAM(MAKE make) | ||
| IF (NOT MAKE) | ||
| MESSAGE(FATAL_ERROR "MAKE not found") | ||
| ENDIF () | ||
|
|
||
| vcpkg_execute_required_process( | ||
| COMMAND make PREFIX=$${CURRENT_PACKAGES_DIR} | ||
| WORKING_DIRECTORY ${SOURCE_PATH} | ||
| LOGNAME make-${TARGET_TRIPLET} | ||
| ) | ||
|
dan-shaw marked this conversation as resolved.
|
||
|
|
||
| # Deploy a copy of the ffnvcodec.pc file where ffmpeg's pkgconfig call expects to find it | ||
| file(INSTALL ${SOURCE_PATH}/ffnvcodec.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) | ||
| endif() | ||
|
|
||
| # Install the files to their generic location as well | ||
| file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) | ||
| file(INSTALL ${CURRENT_PORT_DIR}/copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/ffnvcodec) | ||
|
marcbertola marked this conversation as resolved.
Outdated
|
||
Uh oh!
There was an error while loading. Please reload this page.