|
@@ -34,6 +34,24 @@ class Source(): |
|
|
"path": "/path/to/video.mp4", |
|
|
"path": "/path/to/video.mp4", |
|
|
"provider": "FileInputJSON" |
|
|
"provider": "FileInputJSON" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Instance variables: |
|
|
|
|
|
|
|
|
|
|
|
source -- the source of the media file (eg, a URL or a local path) |
|
|
|
|
|
path -- the path to the media file |
|
|
|
|
|
provider -- the provider of the media file (eg, "FileInputJSON") |
|
|
|
|
|
|
|
|
|
|
|
Accessing the object should return the path to the media file. |
|
|
|
|
|
|
|
|
|
|
|
Methods: |
|
|
|
|
|
|
|
|
|
|
|
duration() -- return the duration of the media file (uses ffprobe, result is cached) |
|
|
|
|
|
|
|
|
|
|
|
Notes: |
|
|
|
|
|
- source and path may be the same, for example in the case of a local file |
|
|
|
|
|
""" |
|
|
|
|
|
_duration = None |
|
|
|
|
|
|
|
|
def __init__(self, source, path, provider): |
|
|
def __init__(self, source, path, provider): |
|
|
if not source: |
|
|
if not source: |
|
|
raise ValueError("Source must be provided") # TODO: #API -- decide if this is necessary |
|
|
raise ValueError("Source must be provided") # TODO: #API -- decide if this is necessary |
|
|