Files
ffmpeg/libavcodec
Dariusz Marcinkiewicz c41155e614 libavcodec: support frame dropping in libvpxenc
vp8 encoder can be configured to drop frames, when e.g. bitrate
overshoot is detected. At present the code responsible for
managing an internal fifo assumes that we will get an output frame per
each frame fed into encoder. That is not the case if the encoder can
decide to drop frames.

Running:
ffmpeg -stream_loop 100 -i dash_video3.webm -c:v libvpx -b:v 50k
-drop-threshold 20 -screen-content-mode 2 output.webm

results in lots of warnings like:
[libvpx @ 0x563fd8aba100] Mismatching timestamps: libvpx 2187 queued
2185; this is a bug, please report it
[libvpx @ 0x563fd8aba100] Mismatching timestamps: libvpx 2189 queued
2186; this is a bug, please report it

followed by:
[vost#0:0/libvpx @ 0x563fd8ab9b40] [enc:libvpx @ 0x563fd8aba080] Error
submitting video frame to the encoder
[vost#0:0/libvpx @ 0x563fd8ab9b40] [enc:libvpx @ 0x563fd8aba080] Error
encoding a frame: No space left on device
[vost#0:0/libvpx @ 0x563fd8ab9b40] Task finished with error code: -28
(No space left on device)
[vost#0:0/libvpx @ 0x563fd8ab9b40] Terminating thread with return code
-28 (No space left on device)

The reason for the above error is that each dropped frame leaves an
extra item in the fifo, which eventually overflows.

The proposed fix is to keep popping elements from the fifo until the
one with the matching pts is found. A side effect of this change is that
the code no longer considers pts mismatch to be a bug.

This has likely regressed around 5bda4ec6c3
when fifo started to be universally used.

Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
2025-12-16 21:53:10 +00:00
..
2025-11-05 15:13:54 +00:00
…
…
…
…
2025-11-05 16:31:59 +00:00
…
…
…
…
…
…
…
2024-08-14 18:21:01 +02:00
…
…
2025-02-04 00:14:14 +01:00
2025-08-03 13:48:47 +02:00
2025-07-29 23:38:16 +02:00
…
…
…
…
2025-08-03 13:48:47 +02:00
2025-04-27 15:52:30 +01:00
2025-04-27 15:52:30 +01:00
2025-08-03 13:48:47 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-09-22 23:46:29 +00:00
…
…
…
…
…
…
…
…
2025-10-08 20:40:08 +02:00
…
…
…
2025-08-03 13:48:47 +02:00
…
…
2025-08-03 13:48:47 +02:00
…
2025-12-13 18:45:17 -03:00
2025-12-13 18:45:17 -03:00
…
…
…
…
…
…
…
2025-08-03 13:48:47 +02:00
…
…
…
…
…
…
…
…
2025-08-03 13:48:47 +02:00
…
…
…
…
…
…
…
…
…
2025-08-03 13:48:47 +02:00
…
2025-11-26 15:16:42 +01:00
…
…
…
…
…
…
…
…
…
2025-11-08 18:48:54 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-08-03 13:48:47 +02:00
…
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-11-08 01:17:46 +01:00
…
…
…
…
…
…
…
…
2025-08-07 19:44:59 +00:00
2025-08-03 13:19:25 +00:00
…
…
2025-08-03 13:48:47 +02:00
…
…
…
2025-07-03 20:35:23 +02:00
…
…
…
…
…
…
…
2025-10-30 03:41:24 +01:00
2025-08-11 20:31:09 +02:00
2025-06-23 17:16:42 +10:00
…
…
…
…
…
…
…
…
2025-05-13 00:20:23 +02:00
2025-08-03 13:48:47 +02:00
…
…
…
…
2025-01-01 20:31:08 +01:00
…
…
…
…
2025-06-06 17:21:37 +02:00
…
…
2025-11-26 15:16:43 +01:00
2025-08-03 13:19:25 +00:00
2025-08-03 13:19:25 +00:00
…
…
…
…
…
…
2025-07-20 01:05:23 +02:00
…
…
…
…
…
…
…
2025-12-13 18:45:17 -03:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-08-03 13:48:47 +02:00
…
2025-05-09 22:26:51 +02:00
2025-08-06 21:04:56 +00:00
…
…
…
…
…
…
…
…
…
2025-08-03 13:48:47 +02:00
…
…
…
…
…
…
…
…
…
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
…
2025-08-03 13:48:47 +02:00
2025-11-09 02:42:17 +01:00
…
…
2025-12-13 18:45:17 -03:00
…
2025-08-03 13:48:47 +02:00
…
…
2025-08-03 13:48:47 +02:00
…
…
…
2025-09-02 17:06:25 +02:00
…
…
…
2025-08-08 18:29:40 +09:00
2025-08-03 13:48:47 +02:00
…
…
…
…
…
…
…
2025-08-03 13:48:47 +02:00
…
…
…
…
…
…
…
…
2025-07-03 20:34:51 +02:00
…
…
…
…
2025-08-03 13:48:47 +02:00
…
…
2025-07-03 20:35:23 +02:00
…
2025-07-03 20:35:32 +02:00
…
2024-11-03 10:53:15 +11:00
2025-11-10 01:46:52 +00:00
2024-11-03 10:53:15 +11:00
2024-11-03 10:53:15 +11:00
2024-11-03 10:53:15 +11:00
…
2025-11-04 10:28:57 +00:00
…
…
2025-04-02 09:25:46 +02:00
…
…
2025-08-11 11:54:31 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
2025-08-03 13:48:47 +02:00
…
…
…
…
2024-06-03 14:13:34 +02:00
2025-08-03 13:48:47 +02:00
…
…
…
…
…
2025-09-26 06:20:30 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-09-22 23:46:29 +00:00
…
…
…
…
…
2024-10-12 11:21:14 -03:00
2024-10-12 11:21:14 -03:00
2024-10-12 11:21:14 -03:00
2024-11-01 12:13:07 +08:00
2024-09-24 15:37:19 +02:00
…
2025-08-03 13:48:47 +02:00
2025-06-21 22:08:52 +02:00
…
…
2025-08-03 13:48:47 +02:00
…
2025-08-20 11:20:14 +02:00
…
…
…
…
2025-08-03 13:48:47 +02:00
2025-11-27 11:34:25 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-08-08 18:29:40 +09:00
…
…
…
2025-08-04 09:12:17 +00:00
…
…
2025-07-03 20:35:23 +02:00
…
…
…
…
2024-09-24 15:37:20 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…