Converting to Opus: 44.1 kHz resampled to 48 kHz |
Converting to Opus: 44.1 kHz resampled to 48 kHz |
Sep 17 2012, 18:40
Post
#1
|
|
|
Group: Members Posts: 1 Joined: 17-September 12 Member No.: 103219 |
So i have a bunch of regular 44100 flac files that i'de like to convert to OPUS file so i have something to listen to when i run, that's not very hard to setup following this guide.
http://www.saunalahti.fi/~cse/Opus/ What does concern me is that opusenc.exe seems to default to a samplingrate of 48000 when you feed it a raw stream (the '-' option as seen in the guide seems to do that) it's easy to see that the .opus files do indeed become converted/upsampled to 48000hz using this method. So my question is, should i override this behavior by adding --raw-rate 44100 to the encoder? Does it matter at all that the files get upsampled? Could it introduce noise or other unwanted side effects? Thanks (yes i know that there aren't many android players yet avail for playback of opus, but the question still remains) Also i think this post belongs to this forums, at least it seemed like it was a good fit, but if i'm wrong please move it :\ This post has been edited by gurkburk: Sep 17 2012, 18:41 |
|
|
|
![]() |
Jan 20 2013, 12:45
Post
#2
|
|
|
Group: Developer Posts: 618 Joined: 6-December 08 From: Erlangen Germany Member No.: 64012 |
I have a similar question as the OP. In my case the input file is at 32 kHz sampling rate, and I want this to be encoded at high rates (i.e. CELT-only). Now there are two ways I can do this:
Which of the two approaches is more efficient? Intuitively I would choose the first approach, since that one only encodes content actually present in the input, but maybe CELT is more efficient on 48-kHz than on 32-kHz input (and the 16-20-kHz spectral range consumes almost no bits)? What do the experts say? Chris -------------------- If I don't reply to your reply, it means I agree with you.
|
|
|
|
Jan 20 2013, 16:35
Post
#3
|
|
![]() Group: Developer Posts: 295 Joined: 22-November 10 From: Japan Member No.: 85902 |
I'm not an "expert" but from what I can see from opusenc.c (and audio-in.c) of opus-tools, it resamples 32kHz input to 48kHz (by speex resampler) before sending to encoder.
CODE if(rate>24000)coding_rate=48000; else if(rate>16000)coding_rate=24000; else if(rate>12000)coding_rate=16000; else if(rate>8000)coding_rate=12000; else coding_rate=8000; CODE if(rate!=coding_rate)setup_resample(&inopt,coding_rate==48000?(complexity+1)/2:5,coding_rate); CODE st=opus_multistream_encoder_create(coding_rate, chan, header.nb_streams, header.nb_coupled, mapping, frame_size<480/(48000/coding_rate)?OPUS_APPLICATION_RESTRICTED_LOWDELAY:OPUS_APPLICATION_AUDIO, &ret); |
|
|
|
Jan 20 2013, 16:47
Post
#4
|
|
![]() Group: Developer Posts: 295 Joined: 22-November 10 From: Japan Member No.: 85902 |
It might have not been enough explanation...
"rate" in the first part is the actual input sampling frequency, and it's get resampled to "coding_rate". |
|
|
|
Jan 20 2013, 22:35
Post
#5
|
|
|
Group: Developer Posts: 618 Joined: 6-December 08 From: Erlangen Germany Member No.: 64012 |
Yes, I expected Opus to resample to 48 kHz internally. The question was more: if it does, will the CELT coder know that the input was upsampled from 32 kHz by the Speex resampler, and limit its encoding bandwidth to 16 kHz (the bandwidth of the original input file), or is the 20-kHz bandwidth of high-bitrate CELT hard-coded regardless of the input sampling rate?
Chris -------------------- If I don't reply to your reply, it means I agree with you.
|
|
|
|
Jan 21 2013, 03:55
Post
#6
|
|
|
Xiph.org Speex developer Group: Developer Posts: 430 Joined: 21-August 02 Member No.: 3134 |
Yes, I expected Opus to resample to 48 kHz internally. The question was more: if it does, will the CELT coder know that the input was upsampled from 32 kHz by the Speex resampler, and limit its encoding bandwidth to 16 kHz (the bandwidth of the original input file), or is the 20-kHz bandwidth of high-bitrate CELT hard-coded regardless of the input sampling rate? Opus doesn't actually have a mode for 16 kHz bandwidth (only 12 and 20). However, the new 1.1-alpha release has new code (it may not be 100% reliable) to avoid wasting bits on frequencies that aren't present in the signal being coded. |
|
|
|
gurkburk Converting to Opus: 44.1 kHz resampled to 48 kHz Sep 17 2012, 18:40
[JAZ] Opus does not natively support 44Khz. The idea is ... Sep 17 2012, 19:03
LithosZA QUOTE So my question is, should i override this be... Sep 17 2012, 19:07
Kohlrabi QUOTE (gurkburk @ Sep 17 2012, 19:40) tha... Sep 17 2012, 19:08
lvqcl QUOTE (gurkburk @ Sep 17 2012, 21:40) whe... Sep 17 2012, 19:14
benski how does the internal resampling effect gapless pl... Sep 17 2012, 19:17
Kohlrabi QUOTE (benski @ Sep 17 2012, 20:17) how d... Sep 17 2012, 19:28
benski QUOTE (Kohlrabi @ Sep 17 2012, 14:28) QUO... Sep 17 2012, 20:22
Brand QUOTE (Kohlrabi @ Sep 17 2012, 20:28) Opu... Sep 17 2012, 20:23
Kohlrabi Apparently I might be wrong, it was deeply rooted ... Sep 17 2012, 20:26
eahm QUOTE (gurkburk @ Sep 17 2012, 10:40) So ... Sep 17 2012, 21:12
yourlord I believe I read in another thread that opus can... Sep 17 2012, 21:27
Dynamic To the OP's question, the resampler in Opus is... Sep 19 2012, 01:15
NullC QUOTE (Dynamic @ Sep 18 2012, 17:15) Also... Sep 19 2012, 05:50
pdq QUOTE (Dynamic @ Sep 18 2012, 20:15) In a... Sep 19 2012, 15:26
Dynamic Thanks again for the corrections, NullC. You know ... Sep 19 2012, 09:00
Brand QUOTE (Dynamic @ Sep 19 2012, 10:00) I gu... Sep 19 2012, 09:55
NullC QUOTE (Brand @ Sep 19 2012, 01:55) EDIT2:... Sep 19 2012, 14:19
Brand I can reproduce with opusenc+opusdec. In fact opus... Sep 19 2012, 15:25
Case I'm usually very sensitive to glitches, but I ... Sep 19 2012, 16:10
punkrockdude Hehe. Gurkburk, du kan inte vara något annat än sv... Oct 8 2012, 13:25
nu774 QUOTE (C.R.Helmrich @ Jan 21 2013, 06:35)... Jan 21 2013, 02:19
C.R.Helmrich Thanks, guys. I'll wait for the 1.1 beta then.... Jan 21 2013, 18:40
IgorC Chris, feel free to submit problematic samples for... Jan 21 2013, 18:44
mzso Why 48kHz?
If the lowpass frequency is 20kHz why ... Mar 14 2013, 15:55
lvqcl QUOTE (mzso @ Mar 14 2013, 18:55) why not... Mar 14 2013, 16:05
wswartzendruber Doesn't the CELT layer work strictly at 48 kHz... Mar 14 2013, 21:58
Dynamic I think the CELT layer in Opus (possibly not in th... Mar 15 2013, 18:28
jmvalin QUOTE (Dynamic @ Mar 15 2013, 13:28) I th... Mar 15 2013, 18:51![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd May 2013 - 20:27 |