video encode speed

Hi Yugui,
Please refer to video_encode_main.cpp attached

ubuntu@tegra-ubuntu:~/tegra_multimedia_api/samples/01_video_encode$ gst-launch-1.0 videotestsrc pattern=1 num-buffers=10 ! 'video/x-raw,format=I420,width=3840,height=2160' ! filesink location= ~/4k.yuv
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:01.394058592
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
ubuntu@tegra-ubuntu:~/tegra_multimedia_api/samples/01_video_encode$ ./video_encode ~/4k.yuv 3840 2160 H265 4k.265 -hpt 1
Failed to query video capabilities: Inappropriate ioctl for device
NvMMLiteOpen : Block : BlockType = 8
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
892744264
842091865
===== NVENC blits (mode: 1) into block linear surfaces =====
Could not read complete frame from input file
File read complete.
----------- Element = enc0 -----------
Total Profiling time = 34.7168
Average FPS = 86.7016
Total units processed = 3011
Average latency(usec) = 68966
Minimum latency(usec) = 4563
Maximum latency(usec) = 70620
-------------------------------------
App run was successful

The result looks good

video_encode_main.cpp (34.2 KB)