Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The decoding time of a single frame is too long. #11

Closed
MapleAura opened this issue Jan 20, 2024 · 6 comments
Closed

The decoding time of a single frame is too long. #11

MapleAura opened this issue Jan 20, 2024 · 6 comments

Comments

@MapleAura
Copy link

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.

image

This is the test code:
image

@nyanmisaka
Copy link
Owner

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.

@daoan1412
Copy link

I have a similar problem, even without using memcpy and Resize.

@MapleAura
Copy link
Author

MapleAura commented Jan 21, 2024

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.
image

@nyanmisaka
Copy link
Owner

@MapleAura

I did find an issue regarding the high latency. Please try this patch and see if it helps.

@MapleAura
Copy link
Author

That's great. It works. :)

@nyanmisaka
Copy link
Owner

Closed by e753665

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants