Why nvv4l2h265enc Latency is 300ms with file based source and 5ms with live source?

Hi,

Setup
Jetson Nano with Jetson Nano Developer Kit SD Card Image

Issue
I tested nvv4l2h265enc latency measurements on Nvidia Nano and observed greater latency with file based(300ms) and less latency with live source(5ms). Can anyone please clarify why latency of nvv4l2h265enc plugin is very less(5ms) with live source and greater(500ms) with file based source ? Gstreamer Pipelines and their results are given below :

Live Source Test

GStreamer Pipeline with Live source(Raspberry Pi Version 2 camera)

gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1, format=NV12’ ! nvv4l2h265enc MeasureEncoderLatency=1 maxperf-enable=1 ! video/x-h265,stream-format=byte-stream ! fakesink sync=true

nvv4l2h265enc latency log file snippet with latency as 5ms

KPI: v4l2: frameNumber= 742 encoder= 5 ms pts= 25577681484

File Based Test

GStreamer Pipeline with file based source

gst-launch-1.0 filesrc location=1080p30_nv12.hevc ! h265parse ! nvv4l2decoder disable-dpb=1 enable-max-performance=1 ! nvv4l2h265enc MeasureEncoderLatency=1 maxperf-enable=1 ! fakesink sync=true

nvv4l2h265enc latency log file snippet with latency as 300ms

KPI: v4l2: frameNumber= 289 encoder= 300 ms pts= 9633333237

Hi,
There is no timestamp information if you read frames from a local file. Suggest you disable synchronization by setting sync=0.