title: capture segmented audio and video with gstreamer
body: <p>I'm trying to record audio and video from internal webcam and mic to segmented files with gstreamer.</p>
  
  <p>It works to a single file by doing:</p>
  
  <pre><code>gst-launch-1.0 -e avfvideosrc ! 
  video/x-raw ! vtenc_h264 ! h264parse ! queue ! 
  mpegtsmux name=mux ! filesink location=test.mp4  osxaudiosrc !
  decodebin ! audioconvert ! faac ! aacparse ! queue ! mux.
  </code></pre>
  
  <p>It doesn't work when doing:</p>
  
  <pre><code>gst-launch-1.0 -e avfvideosrc !
  video/x-raw ! vtenc_h264 ! h264parse ! queue !
  splitmuxsink
   muxer=mpegtsmux
   location=test%04d.mp4
   max-size-time=1000000000
   name=mux  osxaudiosrc !
  decodebin ! audioconvert ! faac ! aacparse ! queue ! mux.
  </code></pre>
  
  <p>saying <code>erroneous pipeline: could not link queue1 to mux</code></p>
  
  <p>I'm using gstreamer 1.12.3 on Mac OSX Sierra</p>
  
  <p>Note: The H264/AAC encoding isn't necessary for what I want to achieve, so if there are solutions that only work with e.g. avimux, for whatever reason, that's fine.</p>
  
  <p><strong>EDIT:</strong> I've tried this on a windows machine with the same error.</p>
  
  <pre><code>gst-launch-1.0 -ev ksvideosrc ! video/x-raw !
  videoconvert ! queue !
  splitmuxsink max-size-time=1000000000 muxer=avimux name=mux
  location=video%04d.avi  autoaudiosrc !
  decodebin ! audioconvert ! queue ! mux.
  </code></pre>
  
  <p>Just like on Mac, replacing splitmuxsink with <code>avimux ! filesink</code> works. I'm sure I'm just missing out on some 'pipeline' logic so any clarifiction that can push me in the right direction would be helpful.</p>