`max_fps` on video files still throttles instead of dropping frames; docstring says dropping would be the default by end of Q4 2024
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- performance
Research direction
Start with resolve_limiter_strategy in stream_vision/streamvision/camera/utils.py, then read the flag definition in inference/core/env.py and its CLI override in inference_cli/lib/workflows/core.py. Compare the three docstrings named in the issue and the Python API behavior; first get a maintainer decision on whether file sources should drop frames by default or retain WAIT. Done means the chosen behavior is consistent across CLI and Python API and the expired-date wording is resolved.
Written by the indexing model from the issue text.
Description
Search before asking
- I have searched the Inference issues and found no similar bug report.
Bug
With a video file as the source, InferencePipeline with max_fps=6 processes every frame and slows down to roughly that rate. I expected it to skip frames, because the max_fps docstring says the frame-dropping behavior "will be the default one end of Q4 2024!" That date has passed, and files still default to the old behavior.
In the code (main at 4c47f51):
resolve_limiter_strategyinstream_vision/streamvision/camera/utils.pyreturnsFPSLimiterStrategy.WAITfor file sources when no strategy is passed.- Dropping frames on files is opt-in through
ENABLE_FRAME_DROP_ON_VIDEO_FILE_RATE_LIMITING, which defaults to"False"ininference/core/env.py. inference_cli/lib/workflows/core.pysets that flag toTrueitself, with a comment saying it's needed until the new behavior becomes the default.- The Q4 2024 note is in three docstrings: once in
stream_vision/streamvision/stream/pipeline.pyand twice ininference/core/interfaces/legacy_stream/inference_pipeline.py.
So the same max_fps on the same file gives different results from the CLI and from the Python API, and the only explanation is a docstring with an expired date. I couldn't find this in the docs site.
On a 15 s, 36 fps dashcam clip (540 frames) with rfdetr-base and max_fps=6:
| Frames processed | Wall time | |
|---|---|---|
| Default | 540 | 92.7 s |
ENABLE_FRAME_DROP_ON_VIDEO_FILE_RATE_LIMITING=True |
90 | 7.8 s |
Environment
inference1.7.3 from PyPI, Python 3.12.14- macOS 27.0.1, Apple M2, no Docker (ONNX Runtime with CoreML)
Minimal Reproducible Example
import time
from inference import InferencePipeline
frames = 0
def on_prediction(predictions, video_frame):
global frames
frames += 1
start = time.time()
pipeline = InferencePipeline.init(
model_id="rfdetr-base",
video_reference="clip.mp4", # any video file; 15 s at 36 fps here
on_prediction=on_prediction,
max_fps=6,
)
pipeline.start()
pipeline.join()
print(f"frames processed: {frames}, wall time: {time.time() - start:.1f}s")
Run it as-is, then again with ENABLE_FRAME_DROP_ON_VIDEO_FILE_RATE_LIMITING=True.
Additional
I'm not sure which fix you'd want:
- Make dropping the default for files. That changes results for anyone who relies on every frame being processed, so it probably needs a release note.
- Keep
WAITas the default and update the three docstrings to describe the flag without the date, plus a short note in theInferencePipelinedocs.
I'm happy to open a PR for either one once you choose. I noticed InferencePipeline is moving into stream_vision, so I'll wait to hear which way you want to go.
Are you willing to submit a PR?
- Yes I'd like to help by submitting a PR!
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 340
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 92
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from roboflow/inference
-
Allow Pillow 13 in inference-sdkMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
roboflow/inference#3335 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
roboflow/inference#3173 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
roboflow/inference#2993 · 2 comments ·
Maintainers usually reply within 1 day
-
Add context manager (__enter__ / __exit__) support to InferencePipelinePossibly taken @KushagraKanaujia claimed this 67 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
roboflow/inference#2744 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
roboflow/inference#1913 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
All issues in roboflow/inference
Similar issues
-
area:core-platform effort:S priority:P3 risk:night-safe status:ready type:test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
randomparity/kdive#3620 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
FinanceFlash/unvibecode#760 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
google-research/google-research#3470 ·
Maintainers usually reply within 21 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
mrvautin/ha-workouts#11 ·