Weird problem here, i use this command to capture my webcam through ffmpeg (through cmd on windows):
ffmpeg -y -t 300 -rtbufsize 1024M -f dshow -i video="Lenovo EasyCamera" -c:v libx264 -preset veryslow -crf 25 Desktop.mkv
and everything works fine. But when i try the very same command through python as a subprocess it fails. Here's the python code:
from subprocess import Popen
cmd = ['ffmpeg', '-y', '-t', '300', '-rtbufsize', '1024M', '-f', 'dshow', '-i', 'video="Lenovo EasyCamera"', '-c:v', 'libx264', '-preset', 'veryslow', '-crf', '25', 'Desktop.mkv']
p = Popen(cmd)
Outputs the following error and freezes:
[dshow @ 00000000023a2cc0] Could not find video device with name ["Lenovo EasyCamera"] among source devices of type video.
video="Lenovo EasyCamera": I/O error
Can anyone figure this out and tell me what i'm doing wrong? Or is it some known bug in python or the subprocess module (using python 3.6.1, but not attached to the specific version if it will help me solve this problem)?
Thanks in advance!
P.S. This question is a follow up to this one, if that's relevant: How to grab laptop webcam video with ffmpeg in windows