Encode Cuda device memory frames to h264 on Tegra K1. Libs, encoders, c++ examples

Hello,

Where is examples for Encoding Cuda device memory frames to h264 on Tegra, using c++?

Best regards, Viktor.

Hi vsw,

Could you provide more information regarding your use case?
What’s the pipeline you’re using?
We need to know where cuda device memory is from, then I can give suggestion.

Thanks

Hi Kayccc,
I have prepared images in CUDA code, such as nppiremap, some copy roi operations. This images stored in CUDA memory allocated via cudaMalloc. This operations produced in loop and i want use HW encoder to write images into h264 file. My system based on Ubuntu 14 and tegra Tk1.
How i can do it? I can’t find any examples with CUDA memory encode to h264.

Best regards, Viktor.

Hi vsw,

If memory is from cudaMalloc, your need memory copy from device to CPU(appsrc).
For encoding API, you can use following pipeline to encode:
appsrc → videoparse → nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)I420’ ! omxh264enc ->appsink

Thanks

Thank you.

Now i am using unified(cudaAllocManaged) memory, so i don’t need to copy to device and from device with cudaDeviceSynchronize() and i can encode frames directly as in your advice.

Best regards, Viktor.