mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 07:31:22 +01:00
[hevc_rkmpp] Zerolatency encoding #27
Labels
No labels
bug
enhancement
help wanted
invalid
pull-request
question
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/ffmpeg-rockchip#27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Gredys on GitHub (Mar 13, 2024).
I am using
hevc_rkmppencoder in C++ and trying to figure out how to enable zero-latency mode.I.e.
send frame = receive packetwithout delays, buffers and etc.What I am trying to do - send real-time captures of game frames over the LAN, display and save them for later usage.
I was using other implementation of ffmpeg for rkmpp (Orange PI 5 Plus) and summary delay wasn't bigger than 1 frame, but it had issues with bit-rate control.
Now, with your project, I can easily control bit-rate and quality, but summary delay is bigger than 3-4 frames, which is not real-time for me. (its hard to react in action games with such delay)
Current problem with encoder is that I always get
AVPacketforAVFramewith 1 frame delay.I.e. sending and receiving data like this:
Code flow and set options are pretty basic: (I'll skip really basic ones, those are to test zero-latency mode)
Is there is any option to force encoder give exactly one packet per frame without buffering it on its side?
P.S. It may be another issue, but will ask in any way -
hevc_rkmppdecoder always crashes after working for a few seconds if using it from C++ code. Is it intended behavior or I need to create another issue?@nyanmisaka commented on GitHub (Mar 13, 2024):
There is no so-called zero-latency mode in MPP. Latency can only be reduced by disabling async encoding, but it's definitely not zero.
I've just push several commits to support setting sync mode with the
-flags +low_delayoption, which is equal to theavctx->flags & AV_CODEC_FLAG_LOW_DELAY. This mode achieves one-input-one-output at the expense of lower FPS.One ticket one issue. The description is too vague.
@nyanmisaka commented on GitHub (Mar 25, 2024):
Closing as the requested feat has been implemented.