HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - Tech => Topic started by: jeffgt14 on 2016-07-19 18:22:49

Title: OGG At 48kHz
Post by: jeffgt14 on 2016-07-19 18:22:49
I'm a little confused on how I'm converting OGG to 48000. If I take a 16/48 file and run:

ffmpeg -i input.flac -f ogg -acodec libvorbis -aq 8 output.ogg

I get a file that is 16/44.1 instead of 16/48. However if I run:

ffmpeg -i input.flac -f ogg -acodec libvorbis -ar 48000 -aq 8 output.ogg

I get a file that's 16/48. So in essence, when I use this command am I downsampling my FLAC file to 44.1k and then upsampling again to 48k or does the -ar 48000 not actually do anything since my input file is already at 48000?
Title: Re: OGG At 48kHz
Post by: o-l-a-v on 2016-07-19 18:52:29
Default for Vorbis (OGG is the name of the container, not the codec) is to output 48khz if thats the input sample rate. (Just tested with foobar + vorbis encoder)
So the resampling must have something to do with ffmpeg...

Resamplers won't bother resampling if the input and output has the same sample rate, I think it's safe to assume ffmpeg won't do that either.
Title: Re: OGG At 48kHz
Post by: jeffgt14 on 2016-07-19 19:50:52
Hmmm oggenc seemed to do the same thing if I didn’t specify –R 48000. I believe oggenc can’t actually read the incoming sample rate though and that’s why I needed to specify –R 48000. I don’t really want to use oggenc though because it kept erasing my replaygain data. You’re probably right though ffmpeg shouldn’t actually change it.
Title: Re: OGG At 48kHz
Post by: AliceWonderMiscreations on 2016-07-22 06:04:13
Tags that you want to preserve should be archived before doing anything that writes tags.

The vorbiscomment command can archive comments from an ogg vorbis file.

This though is why I like the fact that lame stores the replaygain in an mpeg header instead of a tag, and opusenc seems to do the same. That data really imho doesn't belong in tags.