ffmpeg Script

#ffmpeg_scripts.py
#This module contains the various ways of writing the commands for the operating 
#systems that are supported by ffmpeg.
  
import os.path
import os
import stat
  
#-------------------------------------------------------------------
  
def WIN_convert_seq_to_mpeg(parent_dir, bat_name, image_name, image_type, frame_rate, width, height):
    fullpath = os.path.join(parent_dir, bat_name)
    fullpath = fullpath.replace('/','\\')
    outf = open(fullpath, 'w')
    outf.write('ffmpeg.exe -i ')
    outf.write('"%s/%s.%s%s" ' % (parent_dir, image_name, '%%04d', image_type) )
    outf.write('-filter:v fps=fps=%s -s %sx%s -codec:v libx264 -pix_fmt yuv420p ' % (frame_rate, width, height))
    outf.write('"./%s.mp4"' % image_name)
    outf.write("\n")
    outf.write('pause')
    outf.close()
    return fullpath
#-------------------------------------------------------------------