View difference between Paste ID: ru5ngu3j and NUHbPmma
SHOW: | | - or go back to the newest paste.
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)
21+
                            stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
22
    
23
    (out, err) = ffmpeg.communicate()
24
    start_print = False
25
    
26-
    for line in out:
26+
    for line in err:
27
        if 'Input' in line: start_print = True
28
        if start_print: print line
29
        break