关于 NvTranscoder

NvTranscoder.exe 的程序编译出来的是 裸流

需要 h264 封包 到 mp4

可以使用 ffmpeg 命令 

ffmpeg.exe -i "111.mp4" -c:v copy -f mp4 "test111.mp4"

也可以使用代码去封包


ffmpeg.exe 工具

                 下载地址


在解码出 数据后 如果需要对数据进行处理

需要使用 cuda driver API 

不过可以通过和 CUDA runtime API 一起混用

Interoperability between Runtime and Driver APIs

An application can mix runtime API code with driver API code.
If a context is created and made current via the driver API, subsequent runtime calls will pick up this context instead of creating a new one.

If the runtime is initialized (implicitly as mentioned in CUDA C Runtime),cuCtxGetCurrent() can be used to retrieve the context created during initialization.
This context can be used by subsequent driver API calls.
Device memory can be allocated and freed using either API. CUdeviceptr can be cast to regular pointers and vice-versa:

CUdeviceptr devPtr;
float* d_data;
// Allocation using driver API
cuMemAlloc(&devPtr, size);
d_data = (float*)devPtr;
// Allocation using runtime API
cudaMalloc(&d_data, size);
devPtr = (CUdeviceptr)d_data;

In particular, this means that applications written using the driver API can invoke libraries written using the runtime API (such as cuFFT, cuBLAS, ...).
All functions from the device and version management sections of the reference manual can be used interchangeably.

在线文档地址

http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#module

离线 pdf 文档

下载地址


compress H264 with for multiple video streams

使用多路流时进行编码时 会在 nvEncOpenEncodeSessionEx 函数处 报 NV_ENC_ERR_OUT_OF_MEMORY

必须使用两路同时编码

注意在调用cuda时 容易出现找不到ctx的错误

需要加一句cuCtxPushCurrent(ctx);




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值