Skip to content

Commit 3ea9ed9

Browse files
HSPKNicolasHug
andauthored
Ensure fps is integer before passing to av backend (#8991)
Co-authored-by: Nicolas Hug <[email protected]>
1 parent 4cbf9f3 commit 3ea9ed9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchvision/io/video.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def write_video(
115115
# PyAV does not support floating point numbers with decimal point
116116
# and will throw OverflowException in case this is not the case
117117
if isinstance(fps, float):
118-
fps = np.round(fps)
118+
fps = int(np.round(fps))
119119

120120
with av.open(filename, mode="w") as container:
121121
stream = container.add_stream(video_codec, rate=fps)

0 commit comments

Comments
 (0)