Can we write Gstreamer filter plugins that process video frames on the GPU (eg: using OpenGL ES or CUDA) generating output that can be used directly by the hardware video encoder (ie: without being transferred through main memory)? Do we just declare the output image as “video/x-raw(memory:NVMM),format=(string)I420” format or there are various other steps & complications?
For example, this command does video decoding + encoding purely in hardware (~60 FPS for 1080p with just 5% CPU usage):
But I want to modify the image on the GPU (eg: using OpenGL ES) before it gets encoded, so imagine I want to create the element “gpu_rotate” that transforms the video file:
We have gst-nvivafilter which provides a mechanism for user to process the data on GPU by setting ‘CUDA-process’ property, but it’s not ready in TK1, only supported in TX1 now.
You need to download nvsample_cudaprocess_src.tbz2 from source package link of R24.2 release page.
Please refer nvsample_cudaprocess_README.txt for the details of the interface APIs.
Source package also provides Makefile & instructions for on-target compilation.
nvivafilter “cuda-process” property provides decoded video frame access on GPU for post-processing.
Current reference CUDA sample implementation can be replaced with any custom CUDA op.
Following is the example gst-launch pipeline for reference,
Yes nvivafilter does sound like what we want to use, thanks for providing it! But we want it for TK1, since TX1 is out of our price range, so I guess we have to stick with CPU processing for now :-(
i have a test with exact same statement as you mentioned on TK1, and notice that the CPU usage is about 70%, instead of 5%, so is there anything I missed on TK1 to use omxh264enc? this is a big issue for us, due to high CPU consuming, because we are trying to use omxh264enc in our application (with appsrc and appsink) with 150% CPU usage, that is not accepted!
thanks for any suggestion!
“For example, this command does video decoding + encoding purely in hardware (~60 FPS for 1080p with just 5% CPU usage):”