<commit_before>

__author__ = '<NAME>'

from renderchan.module import RenderChanModule
from renderchan.utils import which
import subprocess
import os
import random

class RenderChanFfmpegModule(RenderChanModule):
    def __init__(self):
        RenderChanModule.__init__(self)
        if os.name == 'nt':
            self.conf['binary']=os.path.join(os.path.dirname(__file__),"..\\..\\..\\ffmpeg\\bin\\ffmpeg.exe")
        else:
            self.conf['binary']="ffmpeg"
        self.conf["packetSize"]=0

    def getInputFormats(self):
        return ["mov", "avi", "mpg"]

    def getOutputFormats(self):
        return ["png"]

    def render(self, filename, outputPath, startFrame, endFrame, format, updateCompletion, extraParams={}):

        updateCompletion(0.0)

        # TODO: Progress callback

        commandline=[self.conf['binary'], "-i", filename, os.path.join(outputPath,"output_%04d.png")]
        subprocess.check_call(commandline)

        updateCompletion(1.0)<commit_msg>FFmpeg module: Make sure to create output directory<commit_after>

__author__ = '<NAME>'

from renderchan.module import RenderChanModule
from renderchan.utils import which
import subprocess
import os
import random

class RenderChanFfmpegModule(RenderChanModule):
    def __init__(self):
        RenderChanModule.__init__(self)
        if os.name == 'nt':
            self.conf['binary']=os.path.join(os.path.dirname(__file__),"..\\..\\..\\ffmpeg\\bin\\ffmpeg.exe")
        else:
            self.conf['binary']="ffmpeg"
        self.conf["packetSize"]=0

    def getInputFormats(self):
        return ["mov", "avi", "mpg"]

    def getOutputFormats(self):
        return ["png"]

    def render(self, filename, outputPath, startFrame, endFrame, format, updateCompletion, extraParams={}):

        updateCompletion(0.0)

        if not os.path.exists(outputPath):
            os.mkdir(outputPath)

        # TODO: Progress callback

        commandline=[self.conf['binary'], "-i", filename, os.path.join(outputPath,"output_%04d.png")]
        subprocess.check_call(commandline)

        updateCompletion(1.0)
{'fraction_non_alphanumeric': 0.13863744640304906, 'fraction_numerical': 0.006669842782277275, 'mean_word_length': 3.1666666666666665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7561452', 'n_tokens_mistral': 653, 'n_tokens_neox': 627, 'n_words': 126}