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?
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.