[tsc-devel] Fw: mp3 -> ogg command...
Chris Jacobsen |
Mon, 02 Feb 2015 03:09:23 UTC
For everyone's reference (I was discussing this with Sydney)...
On Friday, January 16, 2015 7:14 AM, Quintus <…s@q…> wrote:
Hi Chris,
Chris Jacobsen <…9@y…> writes:
> If you get a chance later to send me the command you use to convert
> mp3's to ogg's, I wanted to use it to convert Silensir's song. This
> would ensure consistent use of compression settings, etc. I could
> then document it in the wiki so that everyone has this information.
It’s a two-step process. First, you have to determine the bitrate of the
input file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ ffmpeg -i <file>.mp3
[...]
[mp3 @ 0x7ffdf06767e0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'test.mp3':
Duration: 00:01:58.31, start: 0.000000, bitrate: 192 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 192 kb/s
At least one output file must be specified
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
That song has a bitrate of 192 kilobyte per second. Now convert it to
OGG Vorbis with at least that or a higher bitrate (though of course the
song will not magically gain better quality just if you specify a higher
bitrate. That would only be possible if you had a lossless FLAC file):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ ffmpeg -i <file>.mp3 -b:a 192k output.ogg
[...]
Input #0, mp3, from 'test.mp3':
Duration: 00:01:58.31, start: 0.000000, bitrate: 192 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 192 kb/s
Output #0, ogg, to 'output.ogg':
Metadata:
encoder : Lavf56.15.102
Stream #0:0: Audio: vorbis (libvorbis), 44100 Hz, stereo, fltp, 192 kb/s
Metadata:
encoder : Lavc56.13.100 libvorbis
Stream mapping:
Stream #0:0 -> #0:0 (mp3 (native) -> vorbis (libvorbis))
[...]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It might be useful to understand how multimedia file formats work. There’s
generally a “Container” format, in which one or multiple streams of
“encoded” multimedia data reside. For example, if you have an .ogv video
file, you have:
1. Container format: OGG
1. Audio codec: Vorbis
2. Video codec: Theora
From a more general point of view, there’s no difference between audio
and video files therefore; from the outside, it looks the same. An OGG
container may contain only an audio codec, then it’s an audio file. If
it also contains a video codec, it’s a audio+video file. Only a video
codec would also be possible.
Not all container formats support all codecs. OGG and Matroska (MKV) are
formats that support a number of codecs inside them, especially MKV is
very liberal. The combination of Matroska as the container, Vorbis as
the audio codec, and VP8 as the Video codec is known as WEBM.
1. Container format: MKV
1. Audio codec: Vorbis
2. Video codec: VP8
MP3 also is a container format, but the only codec it supports inside it
is AAC, which is covered by several unfree software patents. Thus, if
you say you "convert an MP3 to OGG", what you really do is this:
1. Container format: MP3 -> OGG
1. Audio codec: AAC -> Vorbis
You convert both the container format and the included codec.
A newer alternative to the Vorbis audio codec that recently occured is
the Opus codec. It is usually packaged inside an OGG container.
1. Container format: OGG
1. Audio codec: Opus
Matroska and OGG are patent-free container formats, Vorbis and Opus are
patent-free audio codecs. VP8 is to my knowledge the only patent-free
video codec. Hence, WEBM is the only really free audio+video file
format. It might be that we see a WEBM2 or whatever format that replaces
Vorbis with Opus for the audio. I’m personally doing this with my video
files already and it plays just fine in VLC.
> -Chris
Vale,
Quintus
--
Blog: http://www.quintilianus.eu
I will reject HTML emails. | Ich akzeptiere keine HTML-Nachrichten.
|
Use GnuPG for mail encryption: | GnuPG für Mail-Verschlüsselung:
http://www.gnupg.org | http://gnupg.org/index.de.html