Skip to main content

Topic: Resample quality of FFMPEG? (Read 6899 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • FedeFrede
  • [*]
Resample quality of FFMPEG?
I ran across: http://src.infinitewave.ca/ and realized the difference in quality looking across various SRC.
I use FFMPEG to downsample audio usually from 48Kz to 44.1Khz. Does anyone know how well FFMPEG downsamples in relation to aliasing?

Regards,

Frederik

  • FedeFrede
  • [*]
Resample quality of FFMPEG?
Reply #1
I made my own little investigation and found that FFMPEG kills alot of the higher frequencies due to a lowpass filter not being steep enough.
FFMPEG does however seem to have a sufficient attenuation before Nyquist and therefore don't seem to introduce aliasing.
SSRC on the other hand is much better and preserve the high frequencies due to the extreme steep low pass filter, so that will be my choice from now on

I used a sweep signal taken from http://src.infinitewave.ca/ and did a resample from 96KHz to 44.1 KHz, the result can be seen here:
http://img442.imageshack.us/i/sweep.png/
The first waveform is the original, the second is FFMPEG and the third is SSRC shown in Audacity.

here are the respective spectrum plots:
Original: http://img692.imageshack.us/i/originalh.png/
FFMPEG: http://img202.imageshack.us/i/ffmpeg.png/
SSRC: http://img4.imageshack.us/i/ssrc.png/

/Frederik

Resample quality of FFMPEG?
Reply #2
I made my own little investigation and found that FFMPEG kills alot of the higher frequencies due to a lowpass filter not being steep enough.
FFMPEG does however seem to have a sufficient attenuation before Nyquist and therefore don't seem to introduce aliasing.
SSRC on the other hand is much better and preserve the high frequencies due to the extreme steep low pass filter, so that will be my choice from now on

I used a sweep signal taken from http://src.infinitewave.ca/ and did a resample from 96KHz to 44.1 KHz, the result can be seen here:
http://img442.imageshack.us/i/sweep.png/
The first waveform is the original, the second is FFMPEG and the third is SSRC shown in Audacity.

here are the respective spectrum plots:
Original: http://img692.imageshack.us/i/originalh.png/
FFMPEG: http://img202.imageshack.us/i/ffmpeg.png/
SSRC: http://img4.imageshack.us/i/ssrc.png/

/Frederik


Your ssrc plot does not make sense to me. The ffmpeg shows the relatively gentle slope you mentioned,

  • FedeFrede
  • [*]
Resample quality of FFMPEG?
Reply #3
Quote
Your ssrc plot does not make sense to me. The ffmpeg shows the relatively gentle slope you mentioned,

Compare FMPEG with the two others and look at the axis. It shows that FFMPEG is not a good choice when it comes to resampling and
it's indeed audible.
  • Last Edit: 02 March, 2010, 05:06:10 PM by FedeFrede

  • FedeFrede
  • [*]
Resample quality of FFMPEG?
Reply #4
For further reading, read my blogpost on the topic:
http://transcoding.wordpress.com/2011/11/1...g-using-ffmpeg/

  • bandpass
  • [*][*][*][*]
Resample quality of FFMPEG?
Reply #5
Perhaps you could submit the ffmpeg results to infinite-wave (according to their instructions on the web-page) and let them run their analysis; this way, we can be sure we're comparing like with like.

AFAIK, SSRC is not maintained and may be buggy: see the first upsampling graph at http://www.hydrogenaudio.org/forums/index....st&p=803756

Remember that the audio band is 20Hz to 20kHz; 44/48kHz audio is slightly oversampled to allow for transition-band roll-off. And there's little point in preserving audio above 20k in files when your DAC is going to throw it away during playback anyway.  Furthermore, steep filters are likely to produce undesirable effects such as more clipping and ringing. So the ideal response (leaving aside the question of aliasing) should probably look something like (the green line):

  • FedeFrede
  • [*]
Resample quality of FFMPEG?
Reply #6
Michael Niedermayer made a comment last night on my blogpost stating that you can tweak the filter because of the audio filter options which weren't present when I wrote the original post 2,5 years ago:
http://transcoding.wordpress.com/2011/11/1...g-using-ffmpeg/
  • Last Edit: 07 August, 2012, 04:54:34 AM by FedeFrede

  • smok3
  • [*][*][*][*][*]
  • Moderator
Resample quality of FFMPEG?
Reply #7
any wild guesses why this ffmpeg default is done the way it is?
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung