title: ffmpeg/avconv: transcode using same codec and params as input
body: <p>Is there a way to tell ffmpeg and/or avconv to use for the output the same codec as the one the input is encoded with, but do the transcoding?</p>
  
  <p>I'm looking for something like:</p>
  
  <pre><code>ffmpeg -i input.mp4 -vcodec same_as_input output.mp4
  </code></pre>
  
  <p>Note that I'm not looking for <code>-vcodec copy</code>, as that would copy the stream without transcoding. I want it to do the transcoding but use the same codec the input file is encoded with.</p>
  
  <p>Also, if possible, I'd like to have the same for every possible parameter, that is: use the same bitrate, frame size, etc, take the value for every possible parameter from one given input file, rather than using any other defaults.</p>
  
  <p>The above example may seem stupid because it's oversimplified (the result would be the same as copying), but imagine I add some processing, e.g. a start time and length, or even something more complex such as adding an overlay image, but I want to make sure it's encoded with the same encoder (and possibly the same parameters) as the input file.</p>