I've got a video file, video.mp4
. It is 18 minutes 23 seconds in duration. I am looking to extract the audio only from this video, and create an MP3 of the highest possible quality from the audio in the video.
Some googlefu lead me to this command: ffmpeg -i video.mp4 audio.mp3
The problem is that, this command doubles the length of the audio that's outputted (duration is 36 minutes 46 seconds). It loops the audio track once, so the output contains the entire 18 minutes 23 seconds of audio, then immediately starts the 18 minutes and 23 seconds of audio over again.
Some more googlefu lead me to this flag: -write_xing 0
from this SO question, but even with that flag it still loops the audio.
EDIT: Additional googlefu and me seeming to think it has something to do with 2 audio channels (and perhaps looping channel 2 immediately after channel 1, rather than merging the two) lead me to this flag: -ac 1
to force it to merge stereo -> mono. This did not work also, and it still outputs a 38 minute 46 seconds MP3 file.
How can I extract (to MP3) the audio from a video file, without doubling the duration?