Hi,
For further software development, it may be better to use jetson_multimedia_api. You can check the sample:
/usr/src/jetson_multimedia_api/samples/01_video_encode
In the sample, it demonstrates creating NvBuffer as input buffer to encoder. You can
refer to it and do customization to fill in frame data slice by slice. Once the frame data is complete, queue the buffer into encoder.