Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def encode(input, vcodec, acodec, fmt, output, bin):
- FFMPEG_PATH = bin
- ffmpeg = subprocess.Popen([
- FFMPEG_PATH,
- '-i', input,
- '-c:v', vcodec, '-profile:v', '3',
- '-c:a', acodec,
- '-ar', '48k',
- '-map', '0:0',
- '-map', '0:1', '-map_channel', '0.1.0:0.1',
- '-map', '0:1', '-map_channel', '0.1.1:0.2',
- '-map', '0:1', '-map_channel', '0.1.2:0.3',
- '-map', '0:1', '-map_channel', '0.1.3:0.4',
- '-map', '0:1', '-map_channel', '0.1.4:0.5',
- '-map', '0:1', '-map_channel', '0.1.5:0.6',
- '-map', '0:1', '-map_channel', '0.1.6:0.7',
- '-map', '0:1', '-map_channel', '0.1.7:0.8',
- '-f', fmt,
- '-y', output
- ],
- shell=False)
- (out, err) = ffmpeg.communicate()
- start_print = False
- for line in out:
- if 'Input' in line: start_print = True
- if start_print: print line
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement