I'm using nvencoder. the first encoding time and the second time are too different.

I’m using nvencoder.

The first time you run a file, the first and second time gap is too much, why do you know why?

Encoding input : “Traffic_2560x1600_30_crop.yuv”
output : “1.mp4”
codec : “HEVC”
size : 2560x1600
bitrate : 5000000 bits/sec
vbvMaxBitrate : 0 bits/sec
vbvSize : 0 bits
fps : 30 frames/sec
rcMode : CONSTQP
goplength : INFINITE GOP
B frames : 0
QP : 28
Input Format : YUV 420
preset : HP_PRESET
Picture Structure : Frame Mode
devicetype : CUDA

[ Input Filesize] : 921600000 bytes
Encoded 150 frames in 8745.59ms


Encoding input : “Traffic_2560x1600_30_crop.yuv”
output : “1.mp4”
codec : “HEVC”
size : 2560x1600
bitrate : 5000000 bits/sec
vbvMaxBitrate : 0 bits/sec
vbvSize : 0 bits
fps : 30 frames/sec
rcMode : CONSTQP
goplength : INFINITE GOP
B frames : 0
QP : 28
Input Format : YUV 420
preset : HP_PRESET
Picture Structure : Frame Mode
devicetype : CUDA

[ Input Filesize] : 921600000 bytes
Encoded 150 frames in 1177.17ms


You’re reading nearly 1GB from disk. This sounds like disk caching and a spinning rust HDD. Try priming the cache first, before your initial encode run. (e.g. play the yuv in VLC, or similar.)

THK.!!!