title: gstreamer split multi-channel wav file into separate channels and encode each channel as mp3, alac etc and save to file
body: <p>I need to split a multi-channel wav file and encode each channel into mp3 files.</p>
  
  <p>I know about deinterleave plugin for gtresamer, but I am not sure how to use it for wav file and how to encode the channel stream.</p>
  
  <p>I prefer gtreamer(or ffmpeg) based solution, as I need to limit I/O. I.e, I don't want the intermediate single channel wav files to be written to the storage.</p>
  
  <p>ffmpeg can be used for this in <a href="https://superuser.com/questions/601972/ffmpeg-isolate-one-audio-channel">this way</a>. But, both the switches are not available in <a href="https://bugs.launchpad.net/libav/+bug/1004174" rel="nofollow noreferrer">ubuntu</a> ffmpeg. </p>
  
  <p>snsonic's solutions threw the following error:</p>
  
  <pre><code>(gst-launch-0.10:2218): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-0.10/libgstpng.so': libpng12.so.0: cannot open shared object file: No such file or directory
  
  Setting pipeline to PAUSED ...
  
  Pipeline is PREROLLING ...
  
  ERROR: from element /GstPipeline:pipeline0/GstWavParse:wavparse0: Internal data flow error.
  
  Additional debug info:
  
  gstwavparse.c(1982): gst_wavparse_loop (): /GstPipeline:pipeline0/GstWavParse:wavparse0:
  
  streaming task paused, reason not-linked (-1)
  
  ERROR: pipeline doesn't want to preroll.
  
  Setting pipeline to NULL ...
  
  Freeing pipeline ...
  
  
  
      (gst-launch-0.10:2218): GStreamer-CRITICAL **: gst_caps_unref: assertion `GST_CAPS_REFCOUNT_VALUE (caps) &gt; 0' failed    
  </code></pre>
  
  <p>When I tested using a single channel wav file without deinterleave, the mp3 file was created but it had only noise.</p>