IPB

Welcome Guest ( Log In | Register )

3 Pages V   1 2 3 >  
Reply to this topicStart new topic
ffmpeg vs. SoX for resampling
jkauff
post Feb 5 2013, 11:00
Post #1





Group: Members (Donating)
Posts: 161
Joined: 1-October 01
From: Doylestown, PA
Member No.: 145



I just found out that TAudioConverter, although it has SoX support, uses ffmpeg for bitdepth changes, resampling, and dither. I don't use those functions very much, but I'm curious if anyone has done a quality comparison between the two.
Go to the top of the page
+Quote Post
db1989
post Feb 5 2013, 11:28
Post #2





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



Iím no authority, but thereís always good old http://src.infinitewave.ca/

SoX 14.4.0:
QUOTE

FFmpeg 0.10.4:
QUOTE

blink.gif Letís, er, letís hope FFmpeg has evolved by leaps and bounds since that version was released only about half a year ago.
Go to the top of the page
+Quote Post
bandpass
post Feb 5 2013, 12:33
Post #3





Group: Members
Posts: 326
Joined: 3-August 08
From: UK
Member No.: 56644



QUOTE (db1989 @ Feb 5 2013, 10:28) *
Letís, er, letís hope FFmpeg has evolved by leaps and bounds since that version was released only about half a year ago.

It has, it now uses SoX smile.gif

QUOTE
January, 7, 2013, FFmpeg 1.1
We have made a new major release (1.1) It contains all features and bugfixes of the git master branch. A partial list of new stuff is below:
...
- SOX Resampler support in libswresample

You have to give a command-line option though:
http://ffmpeg.org/trac/ffmpeg/wiki/FFmpeg%...SoX%20Resampler
Go to the top of the page
+Quote Post
jkauff
post Feb 5 2013, 12:36
Post #4





Group: Members (Donating)
Posts: 161
Joined: 1-October 01
From: Doylestown, PA
Member No.: 145



QUOTE (db1989 @ Feb 5 2013, 05:28) *
Iím no authority, but thereís always good old http://src.infinitewave.ca/

SoX 14.4.0:

FFmpeg 0.10.4:

blink.gif Letís, er, letís hope FFmpeg has evolved by leaps and bounds since that version was released only about half a year ago.

Well, FFmpeg is now up to version 1.1.1, and Peter has incorporated it into fb2k, so I think we can assume the program's improved. Whether it's improved for this functionality is another question. Of course, there's a 14.4.1 version of SoX just out, too.
Go to the top of the page
+Quote Post
db1989
post Feb 5 2013, 12:40
Post #5





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



I did notice the large disparity in version numbers between 0.10.4 and now, but I found that 0.10.6 was released as recently as October, so I had to emphasise that the resampling may or may not have had the massive improvements that it so blatantly needs.

Edit: I just saw bandpass’s post, which I missed due to jkauff posting in the interim. Phew! That’s a relief. biggrin.gif

This post has been edited by db1989: Feb 5 2013, 12:41
Go to the top of the page
+Quote Post
bandpass
post Feb 5 2013, 13:05
Post #6





Group: Members
Posts: 326
Joined: 3-August 08
From: UK
Member No.: 56644



QUOTE (jkauff @ Feb 5 2013, 11:36) *
Well, FFmpeg is now up to version 1.1.1, and Peter has incorporated it into fb2k, so I think we can assume the program's improved. Whether it's improved for this functionality is another question. Of course, there's a 14.4.1 version of SoX just out, too.

Oddly, SoX itself is a little behind the curve: 14.4.1 contains the same (slow, by comparison) version of the resampler that's been there for some years, so until SoX 14.5 is released (couple of months I think), the ffmpeg route will give better performance (about 2-3 x faster).

Don't know if it made it into 1.1.1 or not, but I saw that ffmpeg has also recently ported (most of) SoX's dither code.
Go to the top of the page
+Quote Post
lvqcl
post Feb 5 2013, 15:56
Post #7





Group: Developer
Posts: 3362
Joined: 2-December 07
Member No.: 49183



Downloaded TAC(0.7.5.938)(portable).7z. It contains FFmpeg version N-49352-gc46943e built on Jan 26 2013 (Zeranoe build).

And this build wasn't compiled with --enable-libsoxr option, so TAudioConverter resampling should be similar to FFmpeg 0.10.4 from post#2.
Go to the top of the page
+Quote Post
phofman
post Feb 5 2013, 16:32
Post #8





Group: Members
Posts: 300
Joined: 14-February 12
Member No.: 97162



QUOTE (bandpass @ Feb 5 2013, 14:05) *
... (slow, by comparison) ...
the ffmpeg route will give better performance (about 2-3 x faster).


I am not sure speed is the correct measure of quality.
Go to the top of the page
+Quote Post
bandpass
post Feb 5 2013, 17:23
Post #9





Group: Members
Posts: 326
Joined: 3-August 08
From: UK
Member No.: 56644



QUOTE (phofman @ Feb 5 2013, 15:32) *
I am not sure speed is the correct measure of quality.

The conversion quality is the same (graphs for the newer version are @ infinitewave under Audacity 2.0.3); the performance is higher cos it's faster than before.

QUOTE (lvqcl @ Feb 5 2013, 14:56) *
And this build wasn't compiled with --enable-libsoxr option

Zeranoe takes ffmpeg build requests at: http://ffmpeg.zeranoe.com/forum/viewforum.php?f=10
Go to the top of the page
+Quote Post
db1989
post Feb 5 2013, 17:50
Post #10





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



Regardless of different options and builds, something has to be done about the standard of resampling demonstrated by that graph. ohmy.gif
Go to the top of the page
+Quote Post
ozok
post Feb 5 2013, 18:09
Post #11





Group: Members
Posts: 307
Joined: 9-December 12
From: Eskişehir
Member No.: 105075



I've posted a request for a ffmpeg build with libsoxr support to the link bandpass supplied. I'm waiting for a response.
Go to the top of the page
+Quote Post
[JAZ]
post Feb 5 2013, 20:36
Post #12





Group: Members
Posts: 1778
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



QUOTE (db1989 @ Feb 5 2013, 11:28) *
blink.gif Letís, er, letís hope FFmpeg has evolved by leaps and bounds since that version was released only about half a year ago.


Quoting the FAQ:

QUOTE
Are most SRCs really that bad?
No. If you look at the decibel scale to the right from the graphs, you can see that the range of these graphs is very wide: down to -180 dB. The distortions generated by most properly designed SRCs are below -100 dB and can hardly create audible artifacts. However SRCs differ in the transition band of the low-pass filter and in the amount of pre-/post-echo and aliasing. The bottom line is that most tested SRCs range from fairly good to excellent, but the graphs are very sensitive to emphasize the differences.
Go to the top of the page
+Quote Post
db1989
post Feb 5 2013, 20:51
Post #13





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE
QUOTE

Seems to me that those reflections of the actual input signal may still be quite a bit above –96 dB. Does that fall within the remit of “properly designed SRCs”? Even the background static does not look far below –100 dB.

Besides, even if that explanation were applicable, is it really anything other than hand-wringing when there is no real excuse for the algorithm to perform to such a poor standard? Other free programs can resample with many, many times less noise. Why give a free pass to some SRCs just because their distortions might not be audible? Again: “might”.

I thought this was a site that focusses on perceptual quality, sure, but doesn’t skimp on theoretical quality when there’s no good reason to do so.

This post has been edited by db1989: Feb 5 2013, 20:53
Go to the top of the page
+Quote Post
lvqcl
post Feb 5 2013, 21:55
Post #14





Group: Developer
Posts: 3362
Joined: 2-December 07
Member No.: 49183



QUOTE (Alexey Lukin @ Jul 31 2008, 04:10) *
the noise floor on a CD is around -110 dB, considering that the spectrogram display shows a power spectral density, not the waveform level. So, the regular 16-bit dithering noise is actually represented by this color. Here is the graph of the CD noise floor with a standard TPDF dither:



+ a thread about ffmpeg resampling: http://www.hydrogenaudio.org/forums/index....showtopic=79106

This post has been edited by lvqcl: Feb 5 2013, 22:01
Go to the top of the page
+Quote Post
bandpass
post Feb 5 2013, 22:29
Post #15





Group: Members
Posts: 326
Joined: 3-August 08
From: UK
Member No.: 56644



FFmpeg native is even worse going the other way (i.e. upsampling); here's a look at the latest (1.1.1):

96k 0dBFS -> 44100

Artefacts at around -75 (ignoring the main alias).

44100 0dBFS -> 96k

Artefacts at around -67 (ignoring the main image) and easily audible in the last second.

No surprises when using ffmpeg's soxr option:



and it's around 3 times faster than the native one.

It would be good if FFmpeg could drop the native resampler completely, but it's still needed for drift compensation in some circumstances (between async clocks on 2 soundcards, I think).
Go to the top of the page
+Quote Post
bandpass
post Feb 5 2013, 22:39
Post #16





Group: Members
Posts: 326
Joined: 3-August 08
From: UK
Member No.: 56644



QUOTE (lvqcl @ Feb 5 2013, 20:55) *

I think that complaint was mainly about the roll-off which, as can be seen at infinitewave, is appalling, starting at 12kHz. This was recently improved in 1.1.1 though.
Go to the top of the page
+Quote Post
mavere
post Feb 6 2013, 02:58
Post #17





Group: Members
Posts: 8
Joined: 30-May 05
Member No.: 22401



QUOTE (db1989 @ Feb 5 2013, 02:28) *
I’m no authority, but there’s always good old http://src.infinitewave.ca/


That's a fascinating site.

I'm curious though, why are some so bad? It doesn't look like anyone should need to reinvent the wheel so to speak, as there are amazing open-source (SoX) and proprietary (Adobe Audition) options, and hell, even Apple CoreAudio from 5 years ago is decent.

This post has been edited by mavere: Feb 6 2013, 03:01
Go to the top of the page
+Quote Post
IgorC
post Feb 6 2013, 03:43
Post #18





Group: Members
Posts: 1556
Joined: 3-January 05
From: ARG/RUS
Member No.: 18803



http://src.infinitewave.ca/images/Tone/ffmpeg.png

ffmpeg's resampler isn't that bad but some lines are at -105 -100 dB which is a bit above inaudible threshold (-110 dB).
Obviously SoX has much more headroom.

This post has been edited by IgorC: Feb 6 2013, 03:51
Go to the top of the page
+Quote Post
Alexey Lukin
post Feb 6 2013, 04:33
Post #19





Group: Members
Posts: 191
Joined: 31-July 08
Member No.: 56508



These spectral peaks are not bad only for a 1 kHz tone, but they get much worse for higher-frequency tones (as can be seen on a spectrogram).
Go to the top of the page
+Quote Post
nu774
post Feb 6 2013, 05:06
Post #20





Group: Developer
Posts: 522
Joined: 22-November 10
From: Japan
Member No.: 85902



QUOTE (mavere @ Feb 6 2013, 10:58) *
Apple CoreAudio from 5 years ago is decent.

Highest setting of Apple CoreAudio resampler has really (unnecessarily) high SNR, but is 10x or more slower than SoX (at least on Windows).
And even Microsoft resampler of Windows Media Foundation (CLSID_CResamplerMediaObject) has reasonablly good quality / performance, but read this bug on Win7 WaveOut:
http://www.hydrogenaudio.org/forums/index....st&p=788882
It seems that their left hand doesn't know what the right hand is doing.
Go to the top of the page
+Quote Post
bandpass
post Feb 6 2013, 07:48
Post #21





Group: Members
Posts: 326
Joined: 3-August 08
From: UK
Member No.: 56644



QUOTE (IgorC @ Feb 6 2013, 02:43) *
ffmpeg's resampler isn't that bad ...

You're right, it isn't that bad, it's worseósee esp. 2nd graph above.
Go to the top of the page
+Quote Post
LithosZA
post Feb 6 2013, 08:17
Post #22





Group: Members
Posts: 195
Joined: 26-February 11
Member No.: 88525



QUOTE
ve posted a request for a ffmpeg build with libsoxr support to the link bandpass supplied. I'm waiting for a response.


I see there already is a new build with libsoxr support smile.gif
Go to the top of the page
+Quote Post
ozok
post Feb 6 2013, 13:01
Post #23





Group: Members
Posts: 307
Joined: 9-December 12
From: Eskişehir
Member No.: 105075



zeranoe kindly supplied it after my request.
Go to the top of the page
+Quote Post
soulsearchingsun
post Feb 6 2013, 14:34
Post #24





Group: Members
Posts: 145
Joined: 27-January 05
Member No.: 19370



So, where is TOS#8 when everyone agrees on looking at graphs? Not trying to troll, I just smell some bigottery.
Go to the top of the page
+Quote Post
pdq
post Feb 6 2013, 14:46
Post #25





Group: Members
Posts: 3394
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



QUOTE (soulsearchingsun @ Feb 6 2013, 08:34) *
So, where is TOS#8 when everyone agrees on looking at graphs? Not trying to troll, I just smell some bigottery.

Unless someone claims that there is an audible difference, I don't have a problem with looking at spectra.
Go to the top of the page
+Quote Post

3 Pages V   1 2 3 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th August 2014 - 00:48