Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix process_video and add test case #2011

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

Open
cdeil wants to merge 3 commits into roboflow:develop
base: develop
Choose a base branch
Loading
from cdeil:fix/process-video-max-frames-error

Conversation

@cdeil
Copy link

@cdeil cdeil commented Nov 7, 2025

This PR fixes the process_video function.

There used to be an if-else but somewhere the if fell off the truck resulting in a for-else that doesn't make sense.

This PR also fixes the following case of passing a max_frames that is larger than the frames in the video.
Before this PR is would give Exception: Requested frames are outbound and with it it will simply process the whole video, i.e. treat "max" frames as a max but OK if there are less frames (I think what most users expect/want).

import supervision as sv
from supervision.assets import VideoAssets, download_assets
download_assets(VideoAssets.PEOPLE_WALKING)
video_info = sv.VideoInfo.from_video_path("people-walking.mp4")
sv.process_video(
 source_path="people-walking.mp4",
 target_path="people-talking.mp4",
 callback=lambda frame, _: frame,
 max_frames=1000,
)

I also added a test case (the agent wrote it). Not sure if you want such tests or if/how you want to treat temp dirs and example asset video files in this repo. Let me know whatever you prefer and I can remove that or adjust.

@cdeil cdeil requested a review from SkalskiP as a code owner November 7, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@SkalskiP SkalskiP Awaiting requested review from SkalskiP SkalskiP is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /