Skip to content

daft.functions.video_file#

video_file #

video_file(url: Expression, verify: bool = False, io_config: IOConfig | None = None) -> Expression

Converts a string containing a file reference to a daft.VideoFile reference.

Parameters:

Name Type Description Default
url String Expression

the url of the file

required
verify bool

If True, verify that the file exists and is a video file. If ANY files are not videos, this will produce an error.

False
io_config IOConfig, default=None

The IO configuration to use.

None

Returns:

Name Type Description
Expression File[Video] Expression

An expression containing the file reference.

Source code in daft/functions/file_.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
def video_file(url: Expression, verify: bool = False, io_config: IOConfig | None = None) -> Expression:
    """Converts a string containing a file reference to a `daft.VideoFile` reference.

    Args:
        url (String Expression): the url of the file
        verify:
            If True, verify that the file exists and is a video file.
            If **ANY** files are not videos, this will produce an error.

        io_config (IOConfig, default=None): The IO configuration to use.

    Returns:
        Expression (File[Video] Expression): An expression containing the file reference.

    """
    return url._eval_expressions("video_file", verify=verify, io_config=io_config)