H.265 encoding on the TX1

I have a C program with an OpenCV image and I would like to pass it to the H.265 encoder. What’s the best method for doing this? I’ve looked a little at gstreamer, but it’s still not really clear to me how implement this. Any thoughts?

You could look at,

and the case of H.265 encode,
H.265 Encode (NVIDIA accelerated encode)

$ gst-launch-1.0 videotestsrc ! ‘video/x-raw, format=(string)I420, width=(int)640, height=(int)480’ ! omxh265enc ! filesink location=test.h265 -e

Thanks for your response. I actually did see this, but it seems that this needs to be run from the command line. Is there some C API that I can use to call this from within my C program? Or do I need to pipe the output image from my program to gst-launch?

Hi

For passing frames from an external application to GStreamer you could use the ‘appsrc’ GStreamer plugin and launch the pipeline from command line.

Instead of doing this it would probably be easier to include the GStreamer pipeline in your C application. GStreamer was natively written in C and there is an API available. A good starting point for programming might be here: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html or here: http://docs.gstreamer.com/pages/viewpage.action?pageId=327735

For converting the input frames to be usable by the encoder you will need the ‘nvvidconv’ or the ‘videoconvert’ plugin, see e.g. here: https://devtalk.nvidia.com/default/topic/902541/?comment=4752805

Hi Kamm, Thanks, this was exactly what I was looking for!