Write two webcam video with avconv

Have problem capture video with avconv

I using this commands video0 in shell 0 and video1 in shell 1

avconv -f video4linux2 -i /dev/video0 video0.avi
avconv -f video4linux2 -i /dev/video1 video1.avi

But with start second video recorder message

/dev/video1: No space left on device

Question there is the possibility of recording two videos simultaneously?

Other

First capture of video0.avi is work perfectly, but if I interrupt with Ctrl+C and try execute same command the video is not captured.

This message displayed in shell

uvcvideo: Failed to resubmit video URB (-27)

The process still running?

Removing webcam and reconnect work fine in first time.


I ran into the same issue - in my case I resolved it by connecting the webcams to separate USB2 buses. I still cannot make 2 USB webcams work simultaneously on the same bus. I have also found that I must run ffmpeg (now avconv) as root in order to capture and encode both sound and video from both cams simultaneously.

Also, I run this from a bash script, and found I must background one avconv command to run both simultaneously. The script looks like this:


nohup avconv -f video4linux2 -s 640x360 -r 30 /dev/video0 -f alsa -ac 2 -i hw:1,0 -acodec libmp3lame -ab 96k -async1 stream1.mp4

P1=$!

avconv -f video4linux2 -s 640x360 -r 30 /dev/video1 -f alsa -ac 2 -i hw:2,0 -acodec libmp3lame -ab 96k -async1 stream2.mp4

kill $P1

I hope this is helpful to you.


我认为你必须从第一次捕获中杀死进程ID。

链接地址: http://www.djcxy.com/p/81068.html

上一篇: 录制屏幕和网络摄像头到视频文件

下一篇: 用avconv写两个摄像头视频