Convert RGB and BGR data to other format

HI guys,
we want to convert RGB or BGR frame to other format like NV12, I420 but nvvidconv and nvvideoconvert does’nt support these format as input and out put. Even nvbuf_utils header does’nt have these format so should it be better to use CUDA for converting?
Thanks so much

please help me

With gstreamer you may use videoconvert for converting BGR/RGB to/from BGRx/RGBA and use nvvidconv for converting BGRx/RGBA to/from another format such as NV12, I420, YUY2, …
Note that videoconvert uses system memory (video/x-raw) while nvvidconv may expect at least one of its input or output in NVMM memory.

... ! video/x-raw,format=BGR ! videoconvert ! video/x-raw, format=BGRx ! nvvidconv ! video/x-raw(memory:NVMM), format=I420 ! ...

... ! video/x-raw,format=RGB ! videoconvert ! video/x-raw, format=RGBA ! nvvidconv ! video/x-raw(memory:NVMM), format=I420 ! ...