I am trying to start a ffmpeg subprocess
the following command works perfectly
ffmpeg -f alsa -r 16000 -i hw:2,0 -f video4linux2 -s 800x600 -i /dev/video0 -r 30 -f avi -vcodec mpeg4 -vtag xvid -qscale 0 -acodec libmp3lame -ab 96k /home/Desktop/output.avi
when I try this
process = subprocess.Popen(['ffmpeg', '-f alsa', '-r 16000', '-i hw:2,0', '-f video4linux2', '-s 800x600', '-i /dev/video0', '-r 30', '-f avi', '-vcodec mpeg4', '-vtag xvid', '-qscale 0', '-acodec libmp3lame', '-ab 96k', '/home/Desktop/output.avi')])
I get this error
Unrecognized option 'f alsa'.
Error splitting the argument list: Option not found
asked May 15, 2014 at 14:25
user3071933
2071 gold badge4 silver badges10 bronze badges
1 Answer 1
As the error states:
Unrecognized option 'f alsa'.
So each argument needs to be it's own array element:
process = subprocess.Popen(['ffmpeg', '-f', 'alsa', '-r', '16000', ....
answered May 15, 2014 at 14:29
Timothy Brown
2,29019 silver badges22 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-py