Thanks Cameron, your patch timeout mechanism has been tested and improves
performance.
But still works with some issues when B-frames are presented.
This issue was resolved in the attached data, please update your patch
with information
below:
diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c
Using QUERY_TIMEOUT rather than a polling loop with a fixed sleep
results in both better performance and lower power consumption by
sleeping until the frame is ready. The length of the fixed sleep is
constrained to a granularity of at least the process's timer resolution
(typically ~15 ms) which ac