I'm using ffmpeg -i input.mp4 -c:a copy -vn -sn output.m4a to extract audio from an mp4 file. However, when I open the mp4 in Spek, it shows 255kbps AAC and the extracted file is only 200kbps. Also, the spectrogram isn't 1:1 identical, there are small differences. Why is that so? Is it normal, or is there a better way to do it?

  • As per Spek docs, it uses ffmpeg to read and decode files, so my best guess is that Spek uses an older version when ffmpeg did not discard initial samples from MDCT-codec streams. The ffmpeg output should be taken as accurate. – Gyan Sep 19 '18 at 5:01

According to DSP textbooks, shifting the frequency can have significant spectral effects, see "interpolation" and "decimation". If at all possible make sure the sampling frequency and/or bit-rate is exactly the same, that will preserve as much of the audio as is possible. Any other consideration must use various pre-filters to guarantee there is no spectral aliasing.


Try to demux the audio with something like mp4muxer or avidemux.

  • Welcome to Super User! Can you explain how? – bertieb Oct 3 '18 at 22:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.