Problem with target_path parameter in process_video function. #1842
Replies: 4 comments
-
|
Update: It just showed me a result.mp4 file, but it's an empty file. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @hoang-nam-2004 sorry late answer,
I checked your kaggle and I found that you were missing "return" I also did some small changes like you don't need to "re-init" box_annotator or add labels since you also added. Here is my kaggle version from your original kaggle notebook : https://www.kaggle.com/code/onuralpsezer/yolov8-video-inference Better Documentation with example https://supervision.roboflow.com/latest/how_to/track_objects/#run-inference I hope that helps. |
Beta Was this translation helpful? Give feedback.
-
|
Converting to Q&A |
Beta Was this translation helpful? Give feedback.
-
|
Empty result.mp4 almost always comes from the callback returning the wrong thing (or nothing), or returning frames with the wrong shape/dtype. process_video() expects your callback to return a valid np.ndarray frame every time. Quick checklist that usually fixes it: Make sure you return frame at the end of the callback (even if you don’t draw anything). Ensure the returned frame is H×W×3, dtype uint8, and same size each frame. Use an absolute target_path and make sure the folder exists. Minimal working example: import os def callback(frame, index): os.makedirs("out", exist_ok=True) |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Search before asking
Question
Hi, I am trying to follow the documentation: https://supervision.roboflow.com/utils/video/#process_video
I ran the pipeline perfectly in here: https://www.kaggle.com/code/namlh2004/yolov8-video-inference
But I could not find the result video in the target_path
Can anyone have a look at this for me please ?
Thank you!
Additional
No response
Beta Was this translation helpful? Give feedback.
All reactions