File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class VideoDecoder:
4747 Use 1 for single-threaded decoding which may be best if you are running multiple
4848 instances of ``VideoDecoder`` in parallel. Use a higher number for multi-threaded
4949 decoding which is best if you are running a single instance of ``VideoDecoder``.
50+ Passing 0 lets FFmpeg decide on the number of threads.
5051 Default: 1.
5152 device (str or torch.device, optional): The device to use for decoding. Default: "cpu".
5253
@@ -88,6 +89,9 @@ def __init__(
8889 f"Supported values are { ', ' .join (allowed_dimension_orders )} ."
8990 )
9091
92+ if num_ffmpeg_threads is None :
93+ raise ValueError (f"{ num_ffmpeg_threads = } should be an int." )
94+
9195 core .scan_all_streams_to_update_metadata (self ._decoder )
9296 core .add_video_stream (
9397 self ._decoder ,
You can’t perform that action at this time.
0 commit comments