Page 1 of 1

MP4A Rate

Posted: 12 Dec 2014 18:02
by thecaptain0220
I am currently writing a demuxer and I am having an issue getting my AAC audio to play at the correct speed. I am using VLC_CODEC_MP4A and setting the rate to 48000.

Code: Select all

audioFmt.audio.i_rate = 48000;
This doesn't seem to have any effect though. I am seeing debug messages that look like it us detecting 44100.

Code: Select all

main debug: using audio volume module "float_mixer" main debug: input 'f32l' 44100 Hz Stereo frame=1 samples/8 bytes main debug: looking for audio filter module matching "scaletempo": 14 candidates
Is there another way I need to set the rate?

Re: MP4A Rate

Posted: 02 Jan 2015 17:02
by Jean-Baptiste Kempf
the decoder could override that.

Re: MP4A Rate

Posted: 18 Feb 2015 17:07
by thecaptain0220
I was able to get the decoder to use the correct rate using i_extra and p_extra. Its strange though, because even with it being at the correct speed it still plays back too fast.

It is 48000Hz. I am starting my initial timestamp at 0 and adding 21333 to each packet. This plays back the audio smoothly, but too fast. If I increase the PTS by a higher value I get a better speed and pitch, but I get gaps where the audio drops out.