コード例 #1
0
ファイル: transcode.py プロジェクト: DFTi/ScribbeoServer-Py
 def __init__(self, path=None):
   if path:
     self.path = os.path.abspath(path)
   else:  
     name = 'live_segmenter.exe' if WIN32 else 'live_segmenter'
     self.path = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), name)
   self.cmd_tmpl = string.Template(helper.shellquote(self.path)+" 10 $tmpDir $segmentPrefix mpegts $startSegment")
   if not helper.validate_exec(self.path):
     DISABLE_LIVE_TRANSCODE = True
     print "Live transcode disabled. Could not find segmenter at path: "+self.path
コード例 #2
0
ファイル: transcode.py プロジェクト: DFTi/ScribbeoServer-Py
 def __init__(self, path=None):
   if path:
     self.path = os.path.abspath(path)
   else: 
     name = 'ffmpeg.exe' if WIN32 else 'ffmpeg'
     self.path = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), name)
   self.cmd_tmpl = string.Template(helper.shellquote(self.path)+" "
     "-ss $startTime "
     "-i \"$videoPath\" "
     "-vcodec libx264 -r 23.976 "
     "-b $bitrate -bt $bitrate -loglevel quiet "
     "-vf \"crop=iw:ih:0:0,scale=$frameWidth:$frameHeight\" -aspect \"$frameWidth:$frameHeight\" "
     "-acodec libmp3lame -ab 48k -ar 48000 -ac 2 -async 1 "
     "-bufsize 1024k -threads 4 -preset fast -tune grain "
     "-f mpegts - ")
   if not helper.validate_exec(self.path):
     DISABLE_LIVE_TRANSCODE = True
     print "Live transcode disabled. Could not find ffmpeg at path: "+self.path