-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add presets for NVIDIA Video Codec SDK 11.0.10 (pull #1020)
- Loading branch information
1 parent
f46fa02
commit eb6ca2c
Showing
170 changed files
with
16,451 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: nvcodec | ||
on: | ||
push: | ||
paths: | ||
- nvcodec/** | ||
pull_request: | ||
paths: | ||
- nvcodec/** | ||
workflow_dispatch: | ||
env: | ||
CI_DEPLOY_NEED_CUDA: 1 | ||
CI_DEPLOY_MODULE: ${{ github.workflow }} | ||
CI_DEPLOY_PLATFORM: ${{ github.job }} | ||
CI_DEPLOY_SETTINGS: ${{ secrets.CI_DEPLOY_SETTINGS }} | ||
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} | ||
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} | ||
STAGING_REPOSITORY: ${{ secrets.STAGING_REPOSITORY }} | ||
jobs: | ||
linux-x86_64: | ||
runs-on: ubuntu-16.04 | ||
container: centos:6 | ||
steps: | ||
- uses: bytedeco/javacpp-presets/.github/actions/deploy-centos@actions | ||
windows-x86_64: | ||
runs-on: windows-2019 | ||
steps: | ||
- uses: bytedeco/javacpp-presets/.github/actions/deploy-windows@actions | ||
redeploy: | ||
needs: [linux-x86_64, windows-x86_64] | ||
runs-on: ubuntu-16.04 | ||
steps: | ||
- uses: bytedeco/javacpp-presets/.github/actions/redeploy@actions |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
JavaCPP Presets for NVIDIA Video Codec SDK | ||
========================================== | ||
|
||
[![Gitter](https://badges.gitter.im/bytedeco/javacpp.svg)](https://gitter.im/bytedeco/javacpp) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/nvcodec/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/nvcodec) [![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/oss.sonatype.org/org.bytedeco/nvcodec.svg)](http://bytedeco.org/builds/) | ||
<sup>Build status for all platforms:</sup> [![nvcodec](https://github.com/bytedeco/javacpp-presets/workflows/nvcodec/badge.svg)](https://github.com/bytedeco/javacpp-presets/actions?query=workflow%3Anvcodec) <sup>Commercial support:</sup> [![xscode](https://img.shields.io/badge/Available%20on-xs%3Acode-blue?style=?style=plastic&logo=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF////////VXz1bAAAAAJ0Uk5T/wDltzBKAAAAlUlEQVR42uzXSwqAMAwE0Mn9L+3Ggtgkk35QwcnSJo9S+yGwM9DCooCbgn4YrJ4CIPUcQF7/XSBbx2TEz4sAZ2q1RAECBAiYBlCtvwN+KiYAlG7UDGj59MViT9hOwEqAhYCtAsUZvL6I6W8c2wcbd+LIWSCHSTeSAAECngN4xxIDSK9f4B9t377Wd7H5Nt7/Xz8eAgwAvesLRjYYPuUAAAAASUVORK5CYII=)](https://xscode.com/bytedeco/javacpp-presets) | ||
|
||
|
||
License Agreements | ||
------------------ | ||
By downloading these archives, you agree to the terms of the license agreements for NVIDIA software included in the archives. | ||
|
||
### NVIDIA Video Codec SDK | ||
To view the license for NVIDIA Video Codec SDK included in these archives, click [here](https://docs.nvidia.com/video-technologies/video-codec-sdk/license/) | ||
|
||
|
||
Introduction | ||
------------ | ||
This directory contains the JavaCPP Presets module for: | ||
|
||
* NVIDIA Video Codec SDK 11.0.10 https://developer.nvidia.com/nvidia-video-codec-sdk | ||
|
||
Please refer to the parent README.md file for more detailed information about the JavaCPP Presets. | ||
|
||
|
||
Documentation | ||
------------- | ||
Java API documentation is available here: | ||
|
||
* http://bytedeco.org/javacpp-presets/nvcodec/apidocs/ | ||
|
||
|
||
Sample Usage | ||
------------ | ||
Here is a simple example ported to Java from C code based on `Samples/AppEncode/AppEncCuda` and `Samples/AppDecode/AppDec` included in `Video_Codec_SDK_11.0.10.zip` available at: | ||
|
||
* https://developer.nvidia.com/nvidia-video-codec-sdk/download | ||
|
||
We can use [Maven 3](http://maven.apache.org/) to download and install automatically all the class files as well as the native binaries. To run this sample code, after creating the `pom.xml` and `SampleEncodeDecode.java` source files below, simply execute on the command line: | ||
```bash | ||
$ mvn compile exec:java | ||
``` | ||
You can find more encoder and decoder samples in the [`samples`](samples) subdirectory. | ||
|
||
### The `pom.xml` build file | ||
```xml | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.bytedeco.nvcodec</groupId> | ||
<artifactId>sampleencodedecode</artifactId> | ||
<version>1.5.6-SNAPSHOT</version> | ||
<properties> | ||
<exec.mainClass>SampleEncodeDecode</exec.mainClass> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.bytedeco</groupId> | ||
<artifactId>nvcodec-platform</artifactId> | ||
<version>11.0.10-1.5.6-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<!-- Additional dependencies to use bundled CUDA --> | ||
<dependency> | ||
<groupId>org.bytedeco</groupId> | ||
<artifactId>cuda-platform-redist</artifactId> | ||
<version>11.2-8.1-1.5.6-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<sourceDirectory>.</sourceDirectory> | ||
</build> | ||
</project> | ||
``` | ||
|
||
### The `SampleEncodeDecode.java` source file | ||
```java | ||
import org.bytedeco.cuda.cudart.CUctx_st; | ||
import org.bytedeco.javacpp.IntPointer; | ||
import org.bytedeco.nvcodec.nvcuvid.CUVIDDECODECAPS; | ||
|
||
import static org.bytedeco.cuda.global.cudart.*; | ||
import static org.bytedeco.nvcodec.global.nvcuvid.*; | ||
import static org.bytedeco.nvcodec.global.nvencodeapi.*; | ||
|
||
public class SampleEncodeDecode { | ||
public static void checkEncodeApiCall(String functionName, int result) { | ||
if (result != NV_ENC_SUCCESS) { | ||
System.err.printf("ERROR: %s returned '%d' \r\n", functionName, result); | ||
System.exit(-1); | ||
} | ||
} | ||
|
||
public static void checkCudaApiCall(String functionName, int result) { | ||
if (result != CUDA_SUCCESS) { | ||
System.err.printf("ERROR: %s returned '%d' \r\n", functionName, result); | ||
System.exit(-1); | ||
} | ||
} | ||
|
||
public static void main(String[] args) { | ||
int targetGpu = 0; // If you use NVIDIA GPU not '0', changing it. | ||
|
||
CUctx_st cuContext = new CUctx_st(); | ||
|
||
checkCudaApiCall("cuInit", cuInit(0)); | ||
checkCudaApiCall("cuCtxCreate", cuCtxCreate(cuContext, 0, targetGpu)); | ||
// Check encoder max supported version | ||
{ | ||
IntPointer version = new IntPointer(1); | ||
|
||
checkEncodeApiCall("NvEncodeAPIGetMaxSupportedVersion", NvEncodeAPIGetMaxSupportedVersion(version)); | ||
|
||
System.out.printf("Encoder Max Supported Version\t : %d \r\n", version.get()); | ||
} | ||
|
||
// Query decoder capability 'MPEG-1' codec | ||
{ | ||
CUVIDDECODECAPS decodeCaps = new CUVIDDECODECAPS(); | ||
decodeCaps.eCodecType(cudaVideoCodec_HEVC); | ||
decodeCaps.eChromaFormat(cudaVideoChromaFormat_420); | ||
decodeCaps.nBitDepthMinus8(2); // 10 bit | ||
|
||
checkCudaApiCall("cuvidGetDecoderCaps", cuvidGetDecoderCaps(decodeCaps)); | ||
|
||
System.out.printf("Decoder Capability MPEG-1 Codec\t : %s \r\n", (decodeCaps.bIsSupported() != 0)); | ||
} | ||
} | ||
} | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# This file is meant to be included by the parent cppbuild.sh script | ||
if [[ -z "$PLATFORM" ]]; then | ||
pushd .. | ||
bash cppbuild.sh "$@" nvcodec | ||
popd | ||
exit | ||
fi | ||
|
||
case $PLATFORM in | ||
linux-x86_64) | ||
if [[ ! -d "/usr/local/videocodecsdk/" ]]; then | ||
echo "Please install the Video Codec SDK in /usr/local/videocodecsdk/" | ||
exit 1 | ||
fi | ||
;; | ||
windows-x86_64) | ||
if [[ ! -d "C:/Program Files/NVIDIA GPU Computing Toolkit/VideoCodecSDK/" ]]; then | ||
echo "Please install the Video Codec SDK in C:/Program Files/NVIDIA GPU Computing Toolkit/VideoCodecSDK/" | ||
exit 1 | ||
fi | ||
;; | ||
*) | ||
echo "Error: Platform \"$PLATFORM\" is not supported" | ||
;; | ||
esac | ||
|
||
cd ../.. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.bytedeco</groupId> | ||
<artifactId>javacpp-presets</artifactId> | ||
<version>1.5.6-SNAPSHOT</version> | ||
<relativePath>../../</relativePath> | ||
</parent> | ||
|
||
<groupId>org.bytedeco</groupId> | ||
<artifactId>nvcodec-platform</artifactId> | ||
<version>11.0.10-${project.parent.version}</version> | ||
<name>JavaCPP Presets Platform for NVIDIA Video Codec SDK</name> | ||
|
||
<properties> | ||
<javacpp.moduleId>nvcodec</javacpp.moduleId> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.bytedeco</groupId> | ||
<artifactId>cuda-platform</artifactId> | ||
<version>11.2-8.1-${project.parent.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>${javacpp.moduleId}</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>${javacpp.moduleId}</artifactId> | ||
<version>${project.version}</version> | ||
<classifier>${javacpp.platform.linux-x86_64}</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>${javacpp.moduleId}</artifactId> | ||
<version>${project.version}</version> | ||
<classifier>${javacpp.platform.windows-x86_64}</classifier> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>default-jar</id> | ||
<configuration> | ||
<archive> | ||
<manifestEntries> | ||
<Class-Path>${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-windows-x86_64.jar</Class-Path> | ||
</manifestEntries> | ||
</archive> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>empty-javadoc-jar</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
<configuration> | ||
<classifier>javadoc</classifier> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>empty-sources-jar</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
<configuration> | ||
<classifier>sources</classifier> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.moditect</groupId> | ||
<artifactId>moditect-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>add-module-infos</id> | ||
<phase>none</phase> | ||
</execution> | ||
<execution> | ||
<id>add-platform-module-info</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>add-module-info</goal> | ||
</goals> | ||
<configuration> | ||
<modules> | ||
<module> | ||
<file>${project.build.directory}/${project.artifactId}.jar</file> | ||
<moduleInfoSource> | ||
module org.bytedeco.${javacpp.moduleId}.platform { | ||
requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; | ||
requires static org.bytedeco.${javacpp.moduleId}.windows.x86_64; | ||
} | ||
</moduleInfoSource> | ||
</module> | ||
</modules> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
Oops, something went wrong.