0

I am trying to implement a file converter using libav. Currently I am testing just the audio convertion (for example aac input and mp3 output). I am using the code from this question Conversion from mp3 to aac/mp4 container (FFmpeg/c++) but the resulting output file sounds corrupted (too slow, noisy, distorted).

This is the result from converting AAC to mp3. AAC input format is AV_SAMPLE_FMT_FLTP and mp3 output format is AV_SAMPLE_FMT_S16P. It looks like part of the one channel is inverted on the other channel?

I am using avresample to convert the audio data. I just cant find out what is wrong, i already looked through the examples but as i can see i am doing it just like in the examples. Here is my converter class:

http://pastebin.com/c6hvrRaM (.h)

http://pastebin.com/u6iAPHZ9 (.cpp)

I know this is pretty much but I am desperated...

Community
  • 1
  • 1
C0dR
  • 320
  • 1
  • 6
  • 23
  • Even the upper channel does not look like audio. Those sudden silences are not going to happen in real data. The fact that each such silence corresponds to a burst of audio on the lower channel is **highly** suspect. – MSalters Jul 23 '15 at 07:21
  • Yes, thats what I mean. I guess there is something wrong with the resampling or maybe even decoding the source data? – C0dR Jul 23 '15 at 15:14
  • Is your input stereo? – MSalters Jul 23 '15 at 15:45
  • yes, input and output is stereo – C0dR Jul 23 '15 at 16:12
  • Ok I got it working now for mp3, but for example if i choose flac as output format the audio length is 0. the file got around 19 MB and there is content in it but I cant play the file. – C0dR Aug 08 '15 at 18:31

0 Answers0