Advertisement
Codefox

Untitled

May 23rd, 2014
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.07 KB | None | 0 0
  1.     if not re.match('.*matroska,webm,.*', infos, re.DOTALL):
  2.         if re.match('.*, gif, from.*', infos, re.DOTALL):
  3.             pipe = subprocess.Popen([ffmpeg_bin,
  4.                               '-y',  # force overwrite
  5.                               '-i', chunked_file.file.name,
  6.                               '-f', 'webm',
  7.                               '-c:v', 'libvpx',
  8.                               '-crf', '12',
  9.                               '-b:v', '500K',
  10.                               chunked_file.file.name],  # output to original file
  11.                               stdout=subprocess.PIPE,
  12.                               stderr=subprocess.PIPE)
  13.  
  14.             pipe.wait()
  15.  
  16.             pipe = subprocess.Popen([ffmpeg_bin,
  17.                                      '-i', chunked_file.file.name],
  18.                                     stdout=subprocess.PIPE,
  19.                                     stderr=subprocess.PIPE)
  20.  
  21.             pipe.stdout.readline()
  22.             infos = pipe.stderr.read()
  23.         else:
  24.             return AjaxResponseError({'error': 'wrongformat'})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement