Пример #1
0
    def __init__(self, log, base_dir, _id, params=None, resources=None):
        Action.__init__(self, log, base_dir, _id, params, resources)
        self.input_file = None
        self.kttoolbox_worker = None

        if not os.path.isdir(self.tmp_dir):
            os.makedirs(self.tmp_dir)

        if self.name not in self.params:
            self.params[self.name] = {}

        self.kttoolbox_params = self.params.get(self.name)
Пример #2
0
    def __init__(self, log, base_dir, _id, params=None, resources=None):
        Action.__init__(self, log, base_dir, _id, params, resources)
        self.input_file = None
        self.kttoolbox_worker = None

        if not os.path.isdir(self.tmp_dir):
            os.makedirs(self.tmp_dir)

        if self.name not in self.params:
            self.params[self.name] = {}

        self.kttoolbox_params = self.params.get(self.name)
Пример #3
0
    def __init__(self, log, basedir, id_, params=None, resources=None):
        # We don't need a basedir or an id for this action...
        Action.__init__(self, log, '.', None, params, resources)
        self.worker = None
        self.log = log

        self.tool = self.params.get('tool')
        if self.tool is None:
            raise GetCapabilityActionException('required parameter: tool')
        self.option = self.params.get('option')
        if self.option is None:
            raise GetCapabilityActionException('required parameter: option')
        self.regex = self.params.get('regex', False)
        self.success = False
Пример #4
0
    def __init__(self, log, basedir, id_, params=None, resources=None):
        # We don't need a basedir or an id for this action...
        Action.__init__(self, log, '.', None, params, resources)
        self.worker = None
        self.log = log

        self.tool = self.params.get('tool')
        if self.tool is None:
            raise GetCapabilityActionException('required parameter: tool')
        self.option = self.params.get('option')
        if self.option is None:
            raise GetCapabilityActionException('required parameter: option')
        self.regex = self.params.get('regex', False)
        self.success = False
Пример #5
0
    def __init__(self, log, base_dir, _id, params=None, resources=None):
        Action.__init__(self, log, base_dir, _id, params, resources)
        self.input_file = None
        self.thumbnail = None
        self.probe_worker = None
        self.probe2_worker = None
        self.ffmpeg_worker = None

        if not os.path.isdir(self.tmp_dir):
            os.makedirs(self.tmp_dir)

        self.do_thumbnail = self.params.get('thumbnail', False)
        self.do_count_frames = self.params.get('count_frames', False)
        self.do_count_packets = self.params.get('count_packets', False)

        self.thumbnail_options = {
            'width': int(self.params.get('thumbnail_width', 0)),
        }
Пример #6
0
    def __init__(self, log, base_dir, _id, params=None, resources=None):
        Action.__init__(self, log, base_dir, _id, params, resources)
        self.input_file = None
        self.thumbnail = None
        self.probe_worker = None
        self.probe2_worker = None
        self.ffmpeg_worker = None

        if not os.path.isdir(self.tmp_dir):
            os.makedirs(self.tmp_dir)

        self.do_thumbnail = self.params.get("thumbnail", False)
        self.do_count_frames = self.params.get("count_frames", False)
        self.do_count_packets = self.params.get("count_packets", False)

        self.thumbnail_options = {
            "width": int(self.params.get("thumbnail_width", 0)),
        }
    def __init__(self, log, base_dir, _id, params=None, resources=None):
        Action.__init__(self, log, base_dir, _id, params, resources)
        self.input_file = None
        self.output_file = None

        if 'manzanita' not in self.params:
            self.params['manzanita'] = {}

        if 'global' not in self.params['manzanita']:
            self.params['manzanita']['global'] = {}

        if 'stream' not in self.params['manzanita']:
            self.params['manzanita']['stream'] = {}

        if 'video' not in self.params['manzanita']['stream']:
            self.params['manzanita']['stream']['video'] = {}

        if 'audio' not in self.params['manzanita']['stream']:
            self.params['manzanita']['stream']['audio'] = {}
Пример #8
0
    def __init__(self, log, base_dir, _id, params=None, resources=None):
        Action.__init__(self, log, base_dir, _id, params, resources)
        self.input_file = None
        self.output_file = None

        if "manzanita" not in self.params:
            self.params["manzanita"] = {}

        if "global" not in self.params["manzanita"]:
            self.params["manzanita"]["global"] = {}

        if "stream" not in self.params["manzanita"]:
            self.params["manzanita"]["stream"] = {}

        if "video" not in self.params["manzanita"]["stream"]:
            self.params["manzanita"]["stream"]["video"] = {}

        if "audio" not in self.params["manzanita"]["stream"]:
            self.params["manzanita"]["stream"]["audio"] = {}
Пример #9
0
    def __init__(self, log, base_dir, _id, params=None, resources=None):
        Action.__init__(self, log, base_dir, _id, params, resources)
        self.input_file = None
        self.output_file = None

        if 'manzanita' not in self.params:
            self.params['manzanita'] = {}

        if 'global' not in self.params['manzanita']:
            self.params['manzanita']['global'] = {}

        if 'stream' not in self.params['manzanita']:
            self.params['manzanita']['stream'] = {}

        if 'video' not in self.params['manzanita']['stream']:
            self.params['manzanita']['stream']['video'] = {}

        if 'audio' not in self.params['manzanita']['stream']:
            self.params['manzanita']['stream']['audio'] = {}
Пример #10
0
    def __init__(self, log, base_dir, _id, params=None, resources=None):
        Action.__init__(self, log, base_dir, _id, params, resources)

        if not os.path.isdir(self.tmp_dir):
            os.makedirs(self.tmp_dir)

        self.video_codec = self.params.get("video_codec", "imx")
        self.video_bitrate = int(self.params.get("video_bitrate", 50000))
        self.video_letterbox = int(self.params.get("video_letterbox", 0))
        self.video_aspect_ratio = self.params.get("video_aspect_ratio",
                                                  "default")
        self.video_pix_fmt = self.params.get("video_pix_fmt", "default")
        self.video_gop_size = int(self.params.get("video_gop_size", 0))
        self.video_closed_gop = int(self.params.get("video_closed_gop", 0))
        self.video_interlaced = int(self.params.get("video_interlaced", 1))
        self.video_resolution = self.params.get("video_resolution", "default")
        self.prores_profile = self.params.get("prores_profile", "proxy")
        self.video_burn = int(self.params.get("video_burn", 0))

        self.single_frame = self.params.get("single_frame", False)
        self.seek = int(self.params.get("seek", 0))

        self.audio_codec = self.params.get("audio_codec", "pcm")
        self.audio_format = self.params.get("audio_format", "default")
        self.audio_sample_rate = int(
            self.params.get("audio_sample_rate", 48000))
        self.audio_bitrate = int(self.params.get("audio_bitrate", 0))
        self.audio_min_streams = self.params.get("audio_min_streams")
        self.audio_channels_per_stream = int(
            self.params.get("audio_channels_per_stream", 0))

        self.container = self.params.get("container", "mxf")
        self.container_mapping = self.params.get("container_mapping",
                                                 "default")
        self.container_version = self.params.get("container_version",
                                                 "default")
        self.container_reference = int(
            self.params.get("container_reference", 0))
        self.container_hinting = int(self.params.get("container_hinting", 0))
        self.container_essence_dir = self.params.get("container_essence_dir",
                                                     "media.dir/").lstrip("/")
        self.container_abs_essence_dir = os.path.join(
            self.tmp_dir, self.container_essence_dir)

        self.muxer = self.params.get("muxer", "ffmpeg")

        self.decoding_threads = int(self.params.get("decoding_threads", 1))
        self.encoding_threads = int(self.params.get("encoding_threads", 1))

        self.audio_codec_options = {
            "format": self.audio_format,
            "bitrate": self.audio_bitrate,
            "sample_rate": self.audio_sample_rate,
        }

        self.video_codec_options = {
            "bitrate": self.video_bitrate,
            "pix_fmt": self.video_pix_fmt,
            "enable_fourcc_tagging": self.container == "mov",
            "gop_size": self.video_gop_size,
            "closed_gop": self.video_closed_gop,
            "interlaced": self.video_interlaced,
            "resolution": self.video_resolution,
            "prores_profile": self.prores_profile,
        }

        self.container_options = {
            "mapping": self.container_mapping,
            "version": self.container_version,
            "reference": self.container_reference,
        }

        self.burn_options = {
            "box": int(self.params.get("video_burn_box", 0)),
            "text": self.params.get("video_burn_text", ""),
            "timecode": int(self.params.get("video_burn_timecode", 0)),
            "position": self.params.get("video_burn_position", "center"),
            "fontname": self.params.get("video_burn_fontname", "vera"),
            "fontsize": int(self.params.get("video_burn_fontsize", 12)),
            "padding": int(self.params.get("video_burn_padding", 10)),
            "date": int(self.params.get("video_burn_date", 0)),
            "hostname": int(self.params.get("video_burn_hostname", 0)),
        }

        if not os.path.isdir(self.container_abs_essence_dir):
            os.makedirs(self.container_abs_essence_dir)

        if self.muxer == "ffmpeg" and self.container_reference:
            raise TranscodeException(
                "Reference files are not supported with ffmpeg muxer")

        if self.muxer == "bmx" and self.container != "mxf":
            raise TranscodeException("BMX only support MXF muxing")

        if self.container == "mxf":
            if self.video_codec == "xdcamhd" and self.container_mapping == "rdd9":
                self.audio_channels_per_stream = 1
            if self.video_codec == "imx" and self.container_mapping == "d10":
                self.audio_channels_per_stream = 8

        if self.container_hinting and self.muxer != "ffmpeg":
            self.log.warning(
                "Only ffmpeg muxer support file hinting for streaming")

        if self.container_hinting and self.container not in [
                "flv", "mp4", "mov"
        ]:
            self.log.warning("Only flv, mp4 and mov container support hinting")
            self.container_hinting = 0
Пример #11
0
 def run(self, callback=None):
     Action.run(self, callback)
     return AVInfo(self.get_metadata())
Пример #12
0
 def run(self, callback=None):
     Action.run(self, callback)
     return AVInfo(self.get_metadata())
Пример #13
0
    def __init__(self, log, base_dir, _id, params=None, resources=None):
        Action.__init__(self, log, base_dir, _id, params, resources)

        if not os.path.isdir(self.tmp_dir):
            os.makedirs(self.tmp_dir)

        self.video_codec = self.params.get('video_codec', 'imx')
        self.video_bitrate = int(self.params.get('video_bitrate', 50000))
        self.video_letterbox = int(self.params.get('video_letterbox', 0))
        self.video_aspect_ratio = self.params.get('video_aspect_ratio', 'default')
        self.video_pix_fmt = self.params.get('video_pix_fmt', 'yuv422p')
        self.video_gop_size = int(self.params.get('video_gop_size', 0))
        self.video_closed_gop = int(self.params.get('video_closed_gop', 0))
        self.video_interlaced = int(self.params.get('video_interlaced', 1))
        self.video_resolution = self.params.get('video_resolution', 'default')

        self.audio_codec = self.params.get('audio_codec', 'pcm')
        self.audio_format = self.params.get('audio_format', 'default')
        self.audio_sample_rate = int(self.params.get('audio_sample_rate', 48000))
        self.audio_bitrate = int(self.params.get('audio_bitrate', 0))

        self.container = self.params.get('container', 'mxf')
        self.container_mapping = self.params.get('container_mapping', 'default')
        self.container_version = self.params.get('container_version', 'default')
        self.container_reference = int(self.params.get('container_reference', 0))
        self.container_hinting = int(self.params.get('container_hinting', 0))
        self.container_essence_dir = self.params.get('container_essence_dir', 'media.dir/').lstrip('/')
        self.container_abs_essence_dir = os.path.join(self.tmp_dir, self.container_essence_dir)

        self.muxer = self.params.get('muxer', 'ffmpeg')

        self.decoding_threads = int(self.params.get('decoding_threads', 1))
        self.encoding_threads = int(self.params.get('encoding_threads', 1))

        self.audio_codec_options = {
            'format': self.audio_format,
            'bitrate': self.audio_bitrate,
            'sample_rate': self.audio_sample_rate,
        }

        self.video_codec_options = {
            'bitrate': self.video_bitrate,
            'pix_fmt': self.video_pix_fmt,
            'enable_fourcc_tagging': self.container == 'mov',
            'gop_size': self.video_gop_size,
            'closed_gop': self.video_closed_gop,
            'interlaced': self.video_interlaced,
            'resolution': self.video_resolution,
        }

        self.container_options = {
            'mapping': self.container_mapping,
            'version': self.container_version,
            'reference': self.container_reference,
        }

        if not os.path.isdir(self.container_abs_essence_dir):
            os.makedirs(self.container_abs_essence_dir)

        if self.muxer == 'ffmpeg' and self.container_reference:
            raise TranscodeException('Reference files are not supported with ffmpeg muxer')

        if self.muxer == 'bmx' and self.container != 'mxf':
            raise TranscodeException('BMX only support MXF muxing')

        self.demux_channels_per_stream = 0
        if self.container == 'mxf':
            if self.video_codec == 'xdcamhd' and self.container_mapping == 'rdd9':
                self.demux_channels_per_stream = 1
            if self.video_codec == 'imx' and self.container_mapping == 'd10':
                self.demux_channels_per_stream = 8

        if self.container_hinting and self.muxer != 'ffmpeg':
            self.log.warning('Only ffmpeg muxer support file hinting for streaming')

        if self.container_hinting and self.container not in ['flv', 'mp4', 'mov']:
            self.log.warning('Only flv, mp4 and mov container support hinting')
            self.container_hinting = 0
Пример #14
0
 def run(self, callback=None):
     Action.run(self, callback)
     return self.success
Пример #15
0
 def run(self, callback=None):
     Action.run(self, callback)
     return self.success
Пример #16
0
    def __init__(self, log, base_dir, _id, params=None, resources=None):
        Action.__init__(self, log, base_dir, _id, params, resources)

        if not os.path.isdir(self.tmp_dir):
            os.makedirs(self.tmp_dir)

        self.video_codec = self.params.get('video_codec', 'imx')
        self.video_bitrate = int(self.params.get('video_bitrate', 50000))
        self.video_letterbox = int(self.params.get('video_letterbox', 0))
        self.video_aspect_ratio = self.params.get('video_aspect_ratio', 'default')
        self.video_pix_fmt = self.params.get('video_pix_fmt', 'default')
        self.video_gop_size = int(self.params.get('video_gop_size', 0))
        self.video_closed_gop = int(self.params.get('video_closed_gop', 0))
        self.video_interlaced = int(self.params.get('video_interlaced', 1))
        self.video_resolution = self.params.get('video_resolution', 'default')
        self.prores_profile = self.params.get('prores_profile', 'proxy')
        self.video_burn = int(self.params.get('video_burn', 0))

        self.single_frame = self.params.get('single_frame', False)
        self.seek = int(self.params.get('seek', 0))

        self.audio_codec = self.params.get('audio_codec', 'pcm')
        self.audio_format = self.params.get('audio_format', 'default')
        self.audio_sample_rate = int(self.params.get('audio_sample_rate', 48000))
        self.audio_bitrate = int(self.params.get('audio_bitrate', 0))
        self.audio_min_streams = self.params.get('audio_min_streams')
        self.audio_channels_per_stream = int(self.params.get('audio_channels_per_stream', 0))

        self.container = self.params.get('container', 'mxf')
        self.container_mapping = self.params.get('container_mapping', 'default')
        self.container_version = self.params.get('container_version', 'default')
        self.container_reference = int(self.params.get('container_reference', 0))
        self.container_hinting = int(self.params.get('container_hinting', 0))
        self.container_essence_dir = self.params.get('container_essence_dir', 'media.dir/').lstrip('/')
        self.container_abs_essence_dir = os.path.join(self.tmp_dir, self.container_essence_dir)

        self.muxer = self.params.get('muxer', 'ffmpeg')

        self.decoding_threads = int(self.params.get('decoding_threads', 1))
        self.encoding_threads = int(self.params.get('encoding_threads', 1))

        self.audio_codec_options = {
            'format': self.audio_format,
            'bitrate': self.audio_bitrate,
            'sample_rate': self.audio_sample_rate,
        }

        self.video_codec_options = {
            'bitrate': self.video_bitrate,
            'pix_fmt': self.video_pix_fmt,
            'enable_fourcc_tagging': self.container == 'mov',
            'gop_size': self.video_gop_size,
            'closed_gop': self.video_closed_gop,
            'interlaced': self.video_interlaced,
            'resolution': self.video_resolution,
            'prores_profile': self.prores_profile,
        }

        self.container_options = {
            'mapping': self.container_mapping,
            'version': self.container_version,
            'reference': self.container_reference,
        }

        self.burn_options = {
            'box': int(self.params.get('video_burn_box', 0)),
            'text': self.params.get('video_burn_text', ''),
            'timecode': int(self.params.get('video_burn_timecode', 0)),
            'position': self.params.get('video_burn_position', 'center'),
            'fontname': self.params.get('video_burn_fontname', 'vera'),
            'fontsize': int(self.params.get('video_burn_fontsize', 12)),
            'padding': int(self.params.get('video_burn_padding', 10)),
            'date': int(self.params.get('video_burn_date', 0)),
            'hostname': int(self.params.get('video_burn_hostname', 0)),
        }

        if not os.path.isdir(self.container_abs_essence_dir):
            os.makedirs(self.container_abs_essence_dir)

        if self.muxer == 'ffmpeg' and self.container_reference:
            raise TranscodeException('Reference files are not supported with ffmpeg muxer')

        if self.muxer == 'bmx' and self.container != 'mxf':
            raise TranscodeException('BMX only support MXF muxing')

        if self.container == 'mxf':
            if self.video_codec == 'xdcamhd' and self.container_mapping == 'rdd9':
                self.audio_channels_per_stream = 1
            if self.video_codec == 'imx' and self.container_mapping == 'd10':
                self.audio_channels_per_stream = 8

        if self.container_hinting and self.muxer != 'ffmpeg':
            self.log.warning('Only ffmpeg muxer support file hinting for streaming')

        if self.container_hinting and self.container not in ['flv', 'mp4', 'mov']:
            self.log.warning('Only flv, mp4 and mov container support hinting')
            self.container_hinting = 0