Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-11T14:45:03.717Z
Comments.Text: Same resolution?
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-12T09:38:12.613Z
Comments.Text: Yes, same FPS/Resolution
Comments.UserDisplayName: m_c
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-12T12:49:44.500Z
Comments.Text: _"I don't know, how to switch back"_ - as a workaround you may add video2 from the same file as video0.
Comments.UserDisplayName: Qwertiy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-12T14:16:25.123Z
Comments.Text: @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.
Comments.UserDisplayName: m_c
Tags: <ffmpeg>
Title: ffmpeg - switch between two streams from /dev/video* and record to disk
UserDisplayName: m_c
ThreadText: # 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
  
  