ffmpeg: vorbis vs. libvorbis
I'm not asking for help here, just documenting something I just discovered.
Yesterday I wanted to batch-convert a bunch of old wma files to ogg vorbis. Not wanting to go through intermediate wav files, I tried to use ffmpeg to do it in one go. I first tried using the following command (in a loop, which I won't print here). Code:
ffmpeg -i $file -f ogg -acodec vorbis -ab 192k outputdir/$file Switching to the external libvorbis gave me more flexibility, although at a cost of much longer encoding times (note that ffmpeg must have been compiled with libvorbis support first). Code:
ffmpeg -i $file -f ogg -acodec libvorbis -ab 192k outputdir/$file In addition, there's one more difference. The vorbis (libavc) codec provides an entry in the header of the ogg container reporting the average bitrate, but it doesn't appear to provide a similar bitrate header in the vorbis stream itself. Some programs may not report the bitrate value because of this. libvorbis provides both headers, avoiding that problem. So to summarize, libvorbis appears to be a better codec choice than vorbis. |
I tried libvorbis encoder by ffmpeg for converting some FLAC file to Vorbis. I found out that if you use both -aq and -ab with it, the encoding is done using the -aq setting, which sets bitrate accordingly. I suppose it uses this table: http://en.wikipedia.org/wiki/Vorbis#Technical_details (though sizes of files encoded using either -aq 8 or -ab 256k did not match exactly, but were relatively close.)
If you use -aq setting with libvorbis, there is no big difference in encoding times, when compared to vorbis. But if you use -ab setting, encoding time more than doubles. I don't see any advantage in using the -ab setting. I tried playing the converted files by alsaplayer and VLC. ffmpeg doesn't seem to transfer audio tags, such as author and title :( VLC can read more metadata from the files encoded by libvorbis. VLC gives very different results for the track duration: It can not give track duration for the file encoded by vorbis, gives 3 m 35 s for the one encoded by libvorbis using the aq argument, gives 3 m 33 s for the one encoded by libvorbis using the ab argument, and for the original flac it gives 3 m 16 s. In alsaplayer there are less differences: the duration of the file encoded by libvorbis is 3 m 15 s whereas the original and the one encoded by vorbis are 3 m 16 s, which could be a rounding error, I guess. Finally, here are the versions of the programs used: FFmpeg version SVN-r19352-4:0.5+svn20090706-2ubuntu2, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --extra-version=4:0.5+svn20090706-2ubuntu2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --extra-cflags=-I/build/buildd/ffmpeg-0.5+svn20090706/debian/include --enable-shared --disable-static libavutil 49.15. 0 / 49.15. 0 libavcodec 52.20. 0 / 52.20. 0 libavformat 52.31. 0 / 52.31. 0 libavdevice 52. 1. 0 / 52. 1. 0 libavfilter 0. 4. 0 / 0. 4. 0 libswscale 0. 7. 1 / 0. 7. 1 libpostproc 51. 2. 0 / 51. 2. 0 built on Oct 13 2009 22:15:16, gcc: 4.4.1 VLC media player 1.0.2 Goldeneye alsaplayer 0.99.80 I don't know if this is relevant, but the libvorbisenc2 package version is 1.2.0.dfsg-6ubuntu0.1 here in Xubuntu 9.10. |
If you want, supposedly this modified libvorbis produces better quality:
http://www.geocities.jp/aoyoume/aotuv/ |
Quote:
|
|
The tests were made in year 2005. After that there has been new releases of the encoders.
|
Well then you gotta do your own tests. I can always notice it, except with lossless codecs like flac.
|
I doubt you can.
|
The improvements in alternative vorbis encoders are periodically merged back into the reference codebase (according to http://en.wikipedia.org/wiki/Vorbis).
|
Anyway, it is good that some people try to develop better encoders.
|
Quote:
Quote:
As for me not noticing lossy audio, I do notice it, ALWAYS with mp3, ALWAYS ! With vorbis I notice it less, and for some songs not at all, same with aac, which is also quite good. When using flac I cannot notice the difference (it's lossless anyway). Trust me I do notice them, maybe you haven't tried the right type of music. Each codec is better at certain kinds of music, and some songs you can always notice loss. P.S. You also need good speakers to notice it, if you speakers are laptop speakers, well then you can imagine you will not notice any difference. |
All times are GMT -5. The time now is 10:04 PM. |