I would like the properties of the input file to be the same for the output file, so that I do not have a noticeable quality change.
You're going from a lossy codec to another lossy codec. That means you will lose quality no matter what, unless you set the target bit rate so high that the quality loss won't be noticeable (even if it's still there).
The downside is, of course, that the file size will increase. How much, you ask, will it increase? No one can tell. It depends on how good the quality of your input video is, and how easy the video is to encode.
To force a bit rate during conversion, do the following, e.g. for constant 1 MBit/s:
ffmpeg -i in.m4v -c:v libvpx -b:v 1M -c:a libvorbis out.webm
The libvpx
encoder can also work with variable quality, using the -qmin
, -qmax
options:
ffmpeg -i in.m4v -c:v libvpx -qmin 10 -qmax 42 -c:a libvorbis out.webm
Use lower values for both parameters to achieve better quality. Usually FFmpeg would set them to 2/31, but WebM needs a different scale here AFAIK.
ffmpeg -i myfiletoconvert.m4v -c copy output.webm
so that the codecs are copied from the input to the output file.