Skip to content

Commit

Permalink
Merge pull request #1654 from roboflow/revert-1653-feat/infer-video-i…
Browse files Browse the repository at this point in the history
…nfo-in-video-sink

Revert "VideoSink automatically infers video_info"
  • Loading branch information
LinasKo authored Nov 6, 2024
2 parents 01f0f9e + b39ead2 commit 17f482b
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions supervision/utils/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ class VideoSink:
Attributes:
target_path (str): The path to the output file where the video will be saved.
video_info (Optional[VideoInfo]): Information about the output video resolution,
fps, and total frame count. If not provided, the information will be inferred
from the video path.
video_info (VideoInfo): Information about the video resolution, fps,
and total frame count.
codec (str): FOURCC code for video format
Example:
Expand All @@ -83,16 +82,8 @@ class VideoSink:
```
""" # noqa: E501 // docs

def __init__(
self,
target_path: str,
video_info: Optional[VideoInfo] = None,
codec: str = "mp4v",
):
def __init__(self, target_path: str, video_info: VideoInfo, codec: str = "mp4v"):
self.target_path = target_path

if video_info is None:
video_info = VideoInfo.from_video_path(target_path)
self.video_info = video_info
self.__codec = codec
self.__writer = None
Expand Down

0 comments on commit 17f482b

Please sign in to comment.