Hello,
I am using a CTI Rudi, based on Jetson TX2 and Tegra Linux R32.1.
I am using 3 USB cameras, for which I want to generate 3 RTSP streams, using 3 instances of the following gstreamer pipeline (based on the “test-launch” example of RTSP server:
gst_rtsp_media_factory_set_launch (factory_1, "( idsueyesrc config-file=../data/ueye_conf/conf-4cams-ui3881.ini camera-id=1 ! video/x-raw, format=(string)UYVY, width=(int)1080, height=(int)1920, framerate=(fraction)0/1 ! nvvidconv flip-method=1 ! video/x-raw(memory:NVMM), format=(string)NV12 ! omxh265enc bitrate=2000000 ! rtph265pay name=pay0 pt=0 )" );
This works fine at the beginning and I have 3 constant streams at 27FPS on the RTSP client side (the client is simply
gst-launch-1.0 -v playbin uri=rtsp://$IP:8554/stream1 uridecodebin0::source::latency=300 video-sink=fpsdisplaysink
).
Tegrastats shows this at the beginning (NVENC frequency 486MHz):
RAM 1812/7861MB (lfb 680x4MB) CPU [72%@2034,76%@2034,76%@2035,76%@2034,70%@2036,72%@2033] EMC_FREQ 9%@1866 GR3D_FREQ 0%@114 <b>NVENC 486</b> APE 150 MTS fg 0% bg 0% PLL@51C MCPU@51C PMIC@100C Tboard@45C GPU@48.5C BCPU@51C thermal@50.1C Tdiode@47.25C VDD_SYS_GPU 95/95 VDD_SYS_SOC 1820/1601 VDD_4V0_WIFI 76/80 VDD_IN 9467/7910 VDD_SYS_CPU 4598/3469 VDD_SYS_DDR 1735/1519
I installed the gstreamer profiling plugin gstshark, and I am using “GST_TRACERS=“proctime””, so that I can see how much time each gstreamer element takes to process one frame. This is at the beginning when 27FPS are reached:
6ms, 6ms, 39ms to convert one frame:
0:01:15.588064669 5039 0x7f98005770 TRACE GST_TRACER :0:: proctime, element=(string)nvvconv0, time=(string)0:00:00.005849486;
0:01:15.592437168 5039 0x7f14014450 TRACE GST_TRACER :0:: proctime, element=(string)nvvconv2, time=(string)0:00:00.006083214;
0:01:15.623016181 5039 0x7f4c010e80 TRACE GST_TRACER :0:: proctime, element=(string)nvvconv1, time=(string)0:00:00.039421515;
32ms, 12ms, 29ms to encode one frame:
0:01:15.587293407 5039 0x7f04004de0 TRACE GST_TRACER :0:: proctime, element=(string)omxh265enc-omxh265enc2, time=(string)0:00:00.032952638;
0:01:15.600367224 5039 0x7f740041e0 TRACE GST_TRACER :0:: proctime, element=(string)omxh265enc-omxh265enc0, time=(string)0:00:00.012177340;
0:01:15.612943699 5039 0x7f50004630 TRACE GST_TRACER :0:: proctime, element=(string)omxh265enc-omxh265enc1, time=(string)0:00:00.029482665;
However, the frame-rate constantly decreases with time, I waited approximately 20 minutes and it reached 14 fps on the 3 camera streams, also you can see with tegrastats that the frequency of NVENC dropped:
66ms, 66ms, 74ms to convert one frame:
0:21:03.967665686 19061 0x7f04014590 TRACE GST_TRACER :0:: proctime, element=(string)nvvconv2, time=(string)0:00:00.066681856;
0:21:03.990308854 19061 0x7f3800fd90 TRACE GST_TRACER :0:: proctime, element=(string)nvvconv1, time=(string)0:00:00.065748482;
0:21:04.019222924 19061 0x7f88006d40 TRACE GST_TRACER :0:: proctime, element=(string)nvvconv0, time=(string)0:00:00.074154037;
62ms, 64ms, 62ms to encode one frame:
0:21:03.985219005 19061 0x7f28003720 TRACE GST_TRACER :0:: proctime, element=(string)omxh265enc-omxh265enc1, time=(string)0:00:00.062565190;
0:21:04.009875706 19061 0x7f60004f70 TRACE GST_TRACER :0:: proctime, element=(string)omxh265enc-omxh265enc0, time=(string)0:00:00.064911587;
0:21:04.030722556 19061 0x7eec003ca0 TRACE GST_TRACER :0:: proctime, element=(string)omxh265enc-omxh265enc2, time=(string)0:00:00.062977670;
tegrastats shows low frequency of NVENC (115MHz):
RAM 1837/7861MB (lfb 662x4MB) CPU [51%@2034,59%@2034,51%@2034,49%@2034,47%@2034,46%@2035] EMC_FREQ 6%@1866 GR3D_FREQ 0%@114 NVENC 115 APE 150 MTS fg 0% bg 0% PLL@53C MCPU@53C PMIC@100C Tboard@48C GPU@50.5C BCPU@53C thermal@52.2C Tdiode@49.75C VDD_SYS_GPU 96/95 VDD_SYS_SOC 1632/1651 VDD_4V0_WIFI 420/82 VDD_IN 8213/8184 VDD_SYS_CPU 3312/3620 VDD_SYS_DDR 1563/1581
Is this normal behavior of nvvidconv and omxh265enc? Is NVENC lowering its frequency because of temperature? How can I increase the performance to reach a constant 27FPS stream?
Thanks