用avconv写两个网络摄像头视频 [英] Write two webcam video with avconv

查看:197
本文介绍了用avconv写两个网络摄像头视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用avconv捕获视频

Have problem capture video with avconv

我在 shell中使用此命令 video0 video1 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:设备上没有空格

/dev/video1: No space left on device

问题有可能同时录制两个视频?

Question there is the possibility of recording two videos simultaneously?

其他

首先捕获 video0.avi 是完美的工作,但是如果我用Ctrl + C中断并尝试执行相同的命令,视频不被捕获。

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.

此消息显示在shell中

This message displayed in shell


uvcvideo:无法重新提交视频URB(-27)

uvcvideo: Failed to resubmit video URB (-27)

该进程仍在运行?

首次删除网络摄像头并重新连接工作正常。

Removing webcam and reconnect work fine in first time.

推荐答案

我遇到同样的问题 - 在我的情况下,我通过将网络摄像头连接到单独的USB2总线来解决问题。我仍然无法使2个USB网络摄像头在同一条总线上同时工作。我还发现,我必须以root身份运行ffmpeg(现在的avconv),以便同时捕捉和编码来自两个摄像头的声音和视频。

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.

另外,我运行这个从bash脚本,发现我必须背景一个avconv命令同时运行。脚本如下所示:

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.

这篇关于用avconv写两个网络摄像头视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆