Closed MapleAura closed 5 months ago
Bear in mind that memcpy
and Resize
time should not be counted in HW decoding time.
In particular, av_hwframe_transfer_data()
already includes memcpy
for AV_PIX_FMT_DRM_PRIME => AV_PIX_FMT_NV12 conversion.
Therefore your code contains redundant memcpy
.
I have a similar problem, even without using memcpy and Resize.
I've counted the cost on several interfaces. ‘av_read_frame’ cost almost 20ms per frame. I send data three times just receive decoded data once sussessfully. The log message indicates that the queue is full. In other words, the result can only be returned once if the data is read three times and it takes almost 60 ms. According to the information I have observed from the log, it seems that the decoding time is larger than reading time. But from the experiments done by others, if I do not carry out the copy operation (just export drm_prime), the decoding time is only a few ms.
@MapleAura
I did find an issue regarding the high latency. Please try this patch and see if it helps.
That's great. It works. :)
Closed by e753665
When I calculated the time to decode, I found out the average time is almost 84ms.
Open the log and find such a problem “Decoder buffer is full”. This happens regardless of whether I export to NV12 format or drm_prime.
This is the test code: