-
Notifications
You must be signed in to change notification settings - Fork 1
/
ffmpeg.py
27 lines (27 loc) · 945 Bytes
/
ffmpeg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import subprocess
from multiprocessing import Process
from screeninfo import get_monitors
import sounddevice
from scipy.io.wavfile import write
from sys import platform
#from soundrec import voice
#installing ffmpeg to the system
def ffminst():
if(platform=='linux'):
pass
def rec():
l=[]
for i in get_monitors():
i=str(i)
l.append(i[8:-1])
for i in range(len(l)):
l[i]=l[i].split(', ')
print(l)
monit=input("Enter the name of the monitor you are viewing from above list")
for i in range(len(l)):
if(str(l[i][6])==("name="+"'"+str(monit)+"'")):
print('yes')
width=l[i][2][6:]
height=l[i][3][7:]
subprocess.run("ffmpeg -f x11grab -s {width}x{height} -r 25 -i :0.0+0,0 -fflags +igndts -f pulse -async 25 -ac 1 -ar 44100 -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor outq.mp4".format(width=width,height=height),shell=True)
rec()