Advertisement
Guest User

Untitled

a guest
Jun 7th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.29 KB | None | 0 0
  1. def encode(input, vcodec, acodec, fmt, output, bin):
  2.     FFMPEG_PATH = bin
  3.     ffmpeg = subprocess.Popen([
  4.                             FFMPEG_PATH,
  5.                             '-i', input,
  6.                             '-c:v', vcodec, '-profile:v', '3',
  7.                             '-c:a', acodec,
  8.                             '-ar', '48k',
  9.                             '-map', '0:0',
  10.                             '-map', '0:1', '-map_channel', '0.1.0:0.1',
  11.                             '-map', '0:1', '-map_channel', '0.1.1:0.2',
  12.                             '-map', '0:1', '-map_channel', '0.1.2:0.3',
  13.                             '-map', '0:1', '-map_channel', '0.1.3:0.4',
  14.                             '-map', '0:1', '-map_channel', '0.1.4:0.5',
  15.                             '-map', '0:1', '-map_channel', '0.1.5:0.6',
  16.                             '-map', '0:1', '-map_channel', '0.1.6:0.7',
  17.                             '-map', '0:1', '-map_channel', '0.1.7:0.8',
  18.                             '-f', fmt,
  19.                             '-y', output
  20.                             ],
  21.                             shell=False)
  22.    
  23.     (out, err) = ffmpeg.communicate()
  24.     start_print = False
  25.    
  26.     for line in out:
  27.         if 'Input' in line: start_print = True
  28.         if start_print: print line
  29.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement