-
-
Notifications
You must be signed in to change notification settings - Fork 879
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
video: reduce nvenc delay/async_depth to 0 #507
Conversation
Hi! |
Thanks for testing. #485 is a hack to workaround the issue of ffmpeg buffering multiple frames seen in nvenc and amfenc, but this PR appears to be the legitimate fix (albeit for nvenc only). If this PR allows the encoder to throttle down to 1fps at idle but doesn't have delayed frames or excessive lag, I would consider the issue fixed. As for #485, I am going to try some experiments with local builds of ffmpeg to properly remove the encoder delay with the amfenc codec... or, worst case scenario, I now know that I can whatever ugly workaround is necessary, only needs to apply to amfenc in future. Thanks. |
Ok! If there are new changes I can test AMD too. |
I just tried out this build too, and it resolved the problems I was having with screen updates when streaming my Win10 desktop. Am using a 3080 w/nvenc. |
Left: PC / Right: Raspberry pi 3sunshine git + this pull DSCN7670.MOV0.15 .rpm DSCN7671.MOVThe difference is noticeable, in version 0.15 the latency is higher, making gameplay difficult. Spec: Chronometer: |
With this pull request the latency was around ~16-29ms on raspberry pi 3 |
Thanks for doing the latency testing - very informative! I believe that 0.15 was operating with |
If not set manually, it defaults to INT_MAX, which is then reduced to number of surfaces - 1, which can potentially cause encode delay.
f807007
to
b1641e9
Compare
Description
If
delay
is not set manually, it defaults to INT_MAX, which is then reduced to number of surfaces - 1, which can potentially cause encode delay.See:
https://github.com/FFmpeg/FFmpeg/blob/eb1e359a14e04367239a784506e1ae414512a104/libavcodec/nvenc_hevc.c#L110-L111
https://github.com/FFmpeg/FFmpeg/blob/eb1e359a14e04367239a784506e1ae414512a104/libavcodec/nvenc.c#L961
https://forums.developer.nvidia.com/t/nvenc-hevc-ultra-low-latency-with-ffmpeg-libraries-what-should-be-my-expectations/143954/5
Note that I don't own NVIDIA hardware, so this change needs testing by someone else.
Type of Change
Checklist