mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 07:31:22 +01:00
Encoder endofstream problem (lost few final frames) #24
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#24
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 @mcerveny on GitHub (Mar 9, 2024).
Hello.
I found the problem in encoder logic.
27136b05e0/libavcodec/rkmppenc.c (L687-L691)27136b05e0/libavcodec/rkmppenc.c (L776-L779)27136b05e0/libavcodec/encode.c (L353-L354)I did not discover why "ffmpeg" loop does not suffer this problem but my program have this problem. So I try to add busy-loop over rkmpp_get_packet() (if loop is only to "get:" label it sometimes stops for few seconds, please review the logic):
Typical problem (penultimate column shows PTS inserted to encoder, last column shows PTS outputted from encoder, so lost 2 frames (1456376400, 1456380000)):
@nyanmisaka commented on GitHub (Mar 9, 2024):
@mcerveny I managed to find a ffmpeg command that can be used to reproduce the problem. And your patch did fix it.
It seems that ffmpeg is not expecting
codec->encode()to return EAGAIN while the encoder is draining/at eof(!frame). So what you added makes sense.@nyanmisaka commented on GitHub (Mar 10, 2024):
Closed by
7a0200b