Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ffmpeg, avconv and sameq

Earlier I wrote so:

ffmpeg -i input.mp4 -sameq output.mp3

...and thus receive audio from video file. Ffmpeg just taken out or converted audio to mp3 with an appropriate quality. All thanks to key: -sameq [use same quantizer as source]

Now in Ubuntu instead of ffmpeg we have libav and there (in man for avcomv) I see no -sameq key. Well, here is a question: what I have to do now?..

What I have to do now to get converted audio file with the same quality as in original?

PS. -sameq : Use same quantizer as source (implies VBR).

$ man ffmpeg | col -b > ./man_ffmpeg

this man_ffmpeg is there: http://pastebin.com/qYxz1M1E

FFMPEG(1)
NAME
   ffmpeg - ffmpeg video converter
SYNOPSIS
   ffmpeg [[infile options][-i infile]]... {[outfile options] outfile}...
...
...
...
-sameq
   Use same quantizer as source (implies VBR).
...
...
...
SEE ALSO
   avplay(1), avprobe(1), avserver(1) and the Libav HTML documentation
AUTHORS
   The Libav developers
2014-02-06
FFMPEG(1)
like image 462
xiaose Avatar asked Oct 20 '22 00:10

xiaose


1 Answers

You are correct, -sameq option has been deprecated and then removed from avconv, there were many reasons for it. Not the least of it being that there are different quantizers and it makes little sense talking about same quantizer parameters when reencoding between different codecs.

Majority of people, when reencoding are looking for quality, not quantizers. So they should use -qscale n where n is between 1 and 31 representing quality from best to worst.

In a way if you have gotten used to -sameq option, you have fallen victim to a tool that should have been there at best for testing purposes. It doesn't produce anything reasonable, and can be kinned to trying to put "same metadata" into the container that doesn't support it, or doing "copy stream" into an archaic file format (leading to things like AVI with vorbis audio, that can't even be played). You can hack something together that does all these things, but it has no place in a video encoding tool.

I suggest that if you are going to be doing much stress testing of different containers and codecs, then you install ffmpeg which has more tools allowing the creation of frankensteins. If you are reencoding for the purposes of actually keeping the files that you produce or distributing them, than you can create another question explaining your situation, and what is your desired outcome.

In short "How can i create reencoding process with exactly the same quantizer?" Can only be answered with "No".

like image 183
v010dya Avatar answered Oct 23 '22 03:10

v010dya