'Opens the file, creates the pipe.'

def initialize(self, starttime=0):

    self.close()
    if (starttime != 0):
        offset = min(1, starttime)
        i_arg = ['-ss', ('%.06f' % (starttime - offset)), '-i', self.filename, '-ss', ('%.06f' % offset)]
    else:
        i_arg = ['-i', self.filename]
    cmd = (([get_setting('FFMPEG_BINARY')] + i_arg) + ['-loglevel', 'error', '-f', 'image2pipe', '-vf', ('scale=%d:%d' % tuple(self.size)), '-sws_flags', self.resize_algo, '-pix_fmt', self.pix_fmt, '-vcodec', 'rawvideo', '-'])
    popen_params = {'bufsize': self.bufsize, 'stdout': sp.PIPE, 'stderr': sp.PIPE, 'stdin': DEVNULL}
    if (os.name == 'nt'):
        popen_params['creationflags'] = 134217728
    self.proc = sp.Popen(cmd, **popen_params)
