<p>I'm trying to capture two webcams on /dev/video0 and /dev/video1 and write the live feed to disk. I'd like to be able to switch between the two sources every 10 seconds so the resulting video on disk shows only one video stream at a time for 10 seconds and then the other. I hope I'm clear enough :/</p>

<p>I played around with filter_complex without understanding much, but could only get the stream to show video0 for 10 seconds and from then on video1 - I don't know, how to switch back. Something like a command to loop the filter_complex commands...</p>

CC BY-SA 4.0
2019-02-11T14:45:03.717Z
Same resolution?
Gyan
CC BY-SA 4.0
2019-02-12T09:38:12.613Z
Yes, same FPS/Resolution
m_c
CC BY-SA 4.0
2019-02-12T12:49:44.500Z
_"I don't know, how to switch back"_ - as a workaround you may add video2 from the same file as video0.
Qwertiy
CC BY-SA 4.0
2019-02-12T14:16:25.123Z
@Qwertiy I may have been imprecise - no native english speaker here... I'd like to capture from /dev/video0 and /dev/video1 alternating into the same target file (out.mp4)

That means: take the stream from video0 for 10sec and write to out.mp4 - take the stream from video1 for 10sec and continue writing to out.mp4 - and start over again. Without Interruption.
m_c
<ffmpeg>
ffmpeg - switch between two streams from /dev/video* and record to disk
m_c
# ffmpeg - switch between two streams from /dev/video* and record to disk

(Asked by: username_0 on 2019-02-11)

I'm trying to capture two webcams on /dev/video0 and /dev/video1 and write the live feed to disk. I'd like to be able to switch between the two sources every 10 seconds so the resulting video on disk shows only one video stream at a time for 10 seconds and then the other. I hope I'm clear enough :/

I played around with filter\_complex without understanding much, but could only get the stream to show video0 for 10 seconds and from then on video1 - I don't know, how to switch back. Something like a command to loop the filter\_complex commands...

**Tags:** ffmpeg

> **Comments:**
> **username_1**: Same resolution?  
> **username_0**: Yes, same FPS/Resolution  
> **username_2**: _"I don't know, how to switch back"_ - as a workaround you may add video2 from the same file as video0.  
> **username_0**: @username_2 I may have been imprecise - no native english speaker here... I'd like to capture from /dev/video0 and /dev/video1 alternating into the same target file (out.mp4)  That means: take the stream from video0 for 10sec and write to out.mp4 - take the stream from video1 for 10sec and continue writing to out.mp4 - and start over again. Without Interruption.  

---

## 0 answers

