资源简介
英伟达用于视频解码加速的NVDECODE API。NVIDIA Video Codec SDK包括一整套API,示例和文档,用于在Windows和Linux上进行硬件加速视频编码和解码。
代码片段和文件信息
/*
* Copyright 2017-2020 NVIDIA Corporation. All rights reserved.
*
* Please refer to the NVIDIA end user license agreement (EULA) associated
* with this source code for terms and conditions that govern your use of
* this software. Any use reproduction disclosure or distribution of
* this software and related documentation outside the terms of the EULA
* is strictly prohibited.
*
*/
//---------------------------------------------------------------------------
//! \file AppDec.cpp
//! \brief Source file for AppDec sample
//!
//! This sample application illustrates the demuxing and decoding of a media file followed by resize and crop of the output frames.
//! The application supports both planar (YUV420P and YUV420P16) and non-planar (NV12 and P016) output formats.
//---------------------------------------------------------------------------
#include
#include
#include
#include
#include “NvDecoder/NvDecoder.h“
#include “../Utils/NvCodecUtils.h“
#include “../Utils/FFmpegDemuxer.h“
#include “../Common/AppDecUtils.h“
simplelogger::Logger *logger = simplelogger::LoggerFactory::CreateConsoleLogger();
void ConvertSemiplanarToPlanar(uint8_t *pHostframe int nWidth int nHeight int nBitDepth) {
if (nBitDepth == 8) {
// nv12->iyuv
YuvConverter converter8(nWidth nHeight);
converter8.UVInterleavedToPlanar(pHostframe);
} else {
// p016->yuv420p16
YuvConverter converter16(nWidth nHeight);
converter16.UVInterleavedToPlanar((uint16_t *)pHostframe);
}
}
/**
* @brief Function to decode media file and write raw frames into an output file.
* @param cuContext - Handle to CUDA context
* @param szInFilePath - Path to file to be decoded
* @param szOutFilePath - Path to output file into which raw frames are stored
* @param bOutPlanar - Flag to indicate whether output needs to be converted to planar format
* @param cropRect - Cropping rectangle coordinates
* @param resizeDim - Resizing dimensions for output
*/
void DecodeMediaFile(CUcontext cuContext const char *szInFilePath const char *szOutFilePath bool bOutPlanar
const Rect &cropRect const Dim &resizeDim)
{
std::ofstream fpOut(szOutFilePath std::ios::out | std::ios::binary);
if (!fpOut)
{
std::ostringstream err;
err << “Unable to open output file: “ << szOutFilePath << std::endl;
throw std::invalid_argument(err.str());
}
FFmpegDemuxer demuxer(szInFilePath);
NvDecoder dec(cuContext false FFmpeg2NvCodecId(demuxer.GetVideoCodec()) false false &cropRect &resizeDim);
int nVideoBytes = 0 nframeReturned = 0 nframe = 0;
uint8_t *pVideo = NULL *pframe;
bool bDecodeOutSemiPlanar = false;
do {
demuxer.Demux(&pVideo &nVideoBytes);
nframeReturned = dec.Decode(pVideo nVideoBytes);
if (!n
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-06-25 19:52 Video_Codec_SDK_10.0.26\
文件 1439008 2020-06-25 19:48 Video_Codec_SDK_10.0.26\Deprecation_Notices.pdf
目录 0 2020-06-25 19:52 Video_Codec_SDK_10.0.26\Doc\
文件 1463217 2020-06-25 19:49 Video_Codec_SDK_10.0.26\Doc\NVDEC_Application_Note.pdf
文件 1625498 2020-06-25 19:50 Video_Codec_SDK_10.0.26\Doc\NVDEC_VideoDecoder_API_ProgGuide.pdf
文件 1480562 2020-06-25 19:50 Video_Codec_SDK_10.0.26\Doc\NVENC_Application_Note.pdf
文件 1465160 2020-06-25 19:51 Video_Codec_SDK_10.0.26\Doc\NVENC_Preset_Migration_Guide.pdf
文件 1691097 2020-06-25 19:51 Video_Codec_SDK_10.0.26\Doc\NVENC_VideoEncoder_API_ProgGuide.pdf
文件 1583585 2020-06-25 19:52 Video_Codec_SDK_10.0.26\Doc\Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration.pdf
目录 0 2020-06-25 19:46 Video_Codec_SDK_10.0.26\Interface\
文件 52074 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Interface\cuviddec.h
文件 24058 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Interface\nvcuvid.h
文件 237173 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Interface\nvEncodeAPI.h
目录 0 2020-06-25 19:46 Video_Codec_SDK_10.0.26\Lib\
目录 0 2020-06-25 19:46 Video_Codec_SDK_10.0.26\Lib\linux\
目录 0 2020-06-25 19:46 Video_Codec_SDK_10.0.26\Lib\linux\stubs\
目录 0 2020-06-25 19:46 Video_Codec_SDK_10.0.26\Lib\linux\stubs\aarch64\
文件 4736 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Lib\linux\stubs\aarch64\libnvcuvid.so
文件 4736 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Lib\linux\stubs\aarch64\libnvidia-encode.so
目录 0 2020-06-25 19:46 Video_Codec_SDK_10.0.26\Lib\linux\stubs\ppc64le\
文件 3800 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Lib\linux\stubs\ppc64le\libnvcuvid.so
文件 1752 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Lib\linux\stubs\ppc64le\libnvidia-encode.so
目录 0 2020-06-25 19:46 Video_Codec_SDK_10.0.26\Lib\linux\stubs\x86_64\
文件 3528 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Lib\linux\stubs\x86_64\libnvcuvid.so
文件 1480 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Lib\linux\stubs\x86_64\libnvidia-encode.so
目录 0 2020-06-25 19:46 Video_Codec_SDK_10.0.26\Lib\Win32\
文件 9000 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Lib\Win32\nvcuvid.lib
文件 2152 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Lib\Win32\nvencodeapi.lib
目录 0 2020-06-25 19:46 Video_Codec_SDK_10.0.26\Lib\x64\
文件 8152 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Lib\x64\nvcuvid.lib
文件 2232 2020-06-25 19:39 Video_Codec_SDK_10.0.26\Lib\x64\nvencodeapi.lib
............此处省略215个文件信息
相关资源
- CUDA by example 中文:GPU高性能编程CUD
- siftgpu调试之后的版本,经测试可以直
- Nvidia TensorRT官方例程源代码
- 《GPU高性能编程CUDA实战》pdf
- NVIDIA高级SSAO环境遮蔽算法SAmbient Obs
- gpupro7-phone.7z
- 矩阵GPU计算库magma
-
VideoPla
yer_5(FFMPEG Qt视频播放器之播 -
JiaoZiVideoPla
yer - D3D11地形渲染
- 多核与GPU编程附录
- VideoEye 0.1 源代码
- UnityAsset-EasyMovieTextureVideoTexturev3.20[A
- 解决nvidia tx2 在自制底板上usb无法识别
- GPU自适应图像去噪完整程序
- VideoDownloadHelper破解版 浏览器插件
- iSkysoft Video Converter Ultimate 5.1简体中文
- 基于ROS+kcf算法 读取电脑自带摄像
- tensorflow_gpu-1.6.0-cp36-cp36m-win_amd64.zip
- boilsoft video splitter 视频无损分割
- NVIDIA Video Codec SDK 8.0
- Digital Video Image Quality and Perceptual Cod
- CentOS7.6-Offline-nvidia-docker2.tgz
- NVIDIA TURING GPU 架构白皮书.pdf
- NVIDIA.run
- tensorflow_gpu-1.12.0-cp37
-
AVPro Video Pla
yer 1.9.14.zip - cudnn和nvidia等一些安装包
- 网络摄像头视频流获取及存储软件(
-
Unity 中VIdeoPla
yer的视频外部加载- 源
评论
共有 条评论