Iterators
delegate_workers(video_path, output_path, cfg, sampler_cls=VideoSampler)
Delegate the processing of a list of videos to a worker instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
video_path |
str | Generator
|
Path to a video file, a generator of URLs or a list of video files. |
required |
output_path |
str
|
Path to the output folder. |
required |
cfg |
SamplerConfig
|
Configuration for the worker. |
required |
Source code in video_sampler/iterators.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
parallel_video_processing(video_iterable, output_path, is_url, worker_cfg, sampler_cls=VideoSampler, n_workers=None)
Process a list of local video files or video URLs in parallel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
video_iterable |
Iterable[Union[str, tuple]]
|
An iterable of video file paths or video URLs. |
required |
output_path |
str
|
Path to the output folder. |
required |
is_url |
bool
|
Flag to indicate if the video is a URL. |
required |
worker_cfg |
SamplerConfig
|
Configuration for the worker. |
required |
n_workers |
int
|
Number of workers to use. |
None
|
Source code in video_sampler/iterators.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
process_video(video_info, output_path, is_url, worker_cfg, sampler_cls=VideoSampler)
Process a video file or URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
video_info |
Union[str, tuple]
|
A video file path or a tuple containing the video title, URL and subtitles. |
required |
output_path |
str
|
Path to the output folder. |
required |
worker |
Worker
|
Worker instance to process the videos. |
required |
is_url |
bool
|
Flag to indicate if the video is a URL. |
required |
Source code in video_sampler/iterators.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|