title: How do I use ffmpeg to merge all audio streams (in a video file) into one audio channel?
body: <p>I am attempting to use ffmpeg for a number of files. 
  The actual number of audio streams (there is usually one channel per stream) per file isn't known until I'm using ffmpeg.
  The desired outcome is to somehow have ffmpeg get the count of audio channel, use the number in the command line to amerge those into one single audio channel.
  The goal is to create a preview version of the original video file for use in a simple HTML5 page.
  Is this possible in just one call to ffmpeg?
  (Also, apologies as some parts of this problem I'm still learning about)</p>
  
  <p>Edit:
  Dumas stackoverflow asker here.
  Yes, I've been trying multiple combinations of ffmpeg args.
  To answer the other question, we have video files that have multiple streams, usually with single channels.
  I'll post some cmdline examples shortly.</p>
  
  <p>This cmdline example kind of does what I want; there are 8 streams, and I'm able to combine all audio into one. THe issue is having to know the number before running ffmpeg:</p>
  
  <pre><code>ffmpeg -i EXAMPLE.MOV -filter_complex "[0:v]scale=-2:720,format=yuv420p[v];[0:a]amerge=inputs=8[a]" -map "[v]" -map "[a]" -c:v libx264 -crf 23 -preset medium -c:a libmp3lame -ar 44100 -ac 2 OUTPUT.mov
  </code></pre>