35 lines
987 B
Python
35 lines
987 B
Python
|
from ..filters import FFmpegChain, FFmpegFilter
|
||
|
from .base import OBSSource
|
||
|
|
||
|
|
||
|
@OBSSource.type('image_source')
|
||
|
class ImageSource(OBSSource):
|
||
|
def __init__(self, *args, **kwargs):
|
||
|
super().__init__(*args, **kwargs)
|
||
|
self.infile = None
|
||
|
|
||
|
def load(self, data):
|
||
|
self.infile = data['settings']['file']
|
||
|
|
||
|
def to_ffmpeg(self, scene):
|
||
|
return [], [FFmpegChain(
|
||
|
FFmpegFilter('movie', filename=self.infile)
|
||
|
)]
|
||
|
|
||
|
@OBSSource.type('ffmpeg_source')
|
||
|
class FFmpegSource(OBSSource):
|
||
|
def __init__(self, *args, **kwargs):
|
||
|
super().__init__(*args, **kwargs)
|
||
|
self.infile = None
|
||
|
self.loop = False
|
||
|
|
||
|
def load(self, data):
|
||
|
self.infile = data['settings']['local_file']
|
||
|
self.loop = data['settings']['looping']
|
||
|
|
||
|
def to_ffmpeg(self, scene):
|
||
|
return [], [FFmpegChain(
|
||
|
FFmpegFilter('movie', filename=self.infile, loop=0 if self.loop else 1),
|
||
|
FFmpegFilter('realtime')
|
||
|
)]
|