I managed to end up with a few videos that had incorrect audio pitch. At first I thought the video speed was incorrect, but the time and play rate of the video seemed fine. After a little searching I came across a solution.
- Split source into separate video and audio files (various distros use ffmpeg or avconv)
ffmpeg -i -vcodec copy -an 1.mp4 ffmpeg -i 1.wav
- Change audio pitch (install rubberband-cli, could also use audacity or similar). Experiment with the pitch shift (-p option), negative shifts down, positive up.
rubberband -p -2 1.wav 1a.wav
- Recombine into a single file
ffmpeg -i 1.mp4 -i 1a.wav -vcodec copy -strict experimental out.m4v
for i in *.m4v do avconv -i "$i" -vcodec copy -an 1.mp4 avconv -i "$i" 1.wav rubberband -p -2 1.wav 1a.wav avconv -i 1.mp4 -i 1a.wav -vcodec copy -strict experimental out/"$i" rm -f 1.mp4 1.wav 1a.wav done