Multi-DJ livestream toolkit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

34 lines
987 B

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')
)]