Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new recipe: change audio sample rate #238

Open
kieranjol opened this issue Oct 6, 2017 · 12 comments
Open

new recipe: change audio sample rate #238

kieranjol opened this issue Oct 6, 2017 · 12 comments
Assignees

Comments

@kieranjol
Copy link
Collaborator

Hey, this is more of a note to self - I think that this would be useful to document.
I'd just use -ar to do it, but perhaps there are better ways, @privatezero @jamessam? I guess sox might do it too, but an ffmpeg method of doing it would be ideal I guess.

@retokromer
Copy link
Member

For audio manipulations like time-stretching and pitch-shifting we compile FFmpeg --with-rubberband.

@richardpl
Copy link

One can use atempo and asetrate filter too.

@retokromer
Copy link
Member

We use rubberband instead of asetrate, because it gives better results.

@privatezero
Copy link
Member

@kieranjol, are you thinking more a recipe for creating a down sampled mezzanine? (Like going from 96 kHz/24 bit -> 48 kHz/16 bit) Or manipulations like @retokromer was talking about?

@kieranjol
Copy link
Collaborator Author

Aye, I was thinking of going from 96/24 to 48/16, I think I had some weird case where I needed to do that. It's so long ago that I forgot the specific use case!

@retokromer
Copy link
Member

Also from 96/24 (preservation) to 48/24 (mezzanine) is used in the archive world. A note at the other case would be sufficient.

@richardpl
Copy link

asetrate is not meant as replacement of rubberband ....

@retokromer
Copy link
Member

Therefore I suggested, if we agree on including also more complex audio filtering, to consider rubberband as well.

@privatezero
Copy link
Member

@kieranjol maybe you were going to 44.1/16 to make files that were red book spec? Perhaps that would be a good recipe to create? Typically I have been using -ar when I have needed to, but I know FFmpeg supports another way - would have to test it out to see if there is an audible difference!

Also, would need to note dithering in that recipe, which as an aside reminds me that I have been testing a bit with triangular dither as opposed to the square dither currently in ffmprovisr - might be worth looking into!

@retokromer
Copy link
Member

Also, would need to note dithering in that recipe, which as an aside reminds me that I have been testing a bit with triangular dither as opposed to the square dither currently in ffmprovisr - might be worth looking into!

+1

@privatezero
Copy link
Member

Not entirely scientific, but I ran a little test using one of the test files here using different methods to go from 96 kHz to 44.1 kHz in FFmpeg, and then visualized the spectrum to see if I could notice any artifacts. It looks to me like both setting -ar and out_sample_rate are using the default FFmpeg resampler, so no difference there. libsox does seem to avoid that blip (of aliasing?) at the end, but my days of hearing above 18 kHz are behind me, so no idea if there is an audible difference.

out_sample_rate 44100
resample

-ar 44100
ar

-af aresample=resampler=soxr -ar 44100
soxr

@kieranjol
Copy link
Collaborator Author

kieranjol commented Nov 16, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants