Command line
If you're willing to forgo using a GUI you can use ffmpeg
fairly easily to do this.
Sample file
If you go to QuickTime: Sample files, you can download this sample file, sample_mpeg4.mp4. After downloading it, unzip it.
$ ls -l | grep sample
-rw-rw-r-- 1 saml saml 235829 Nov 4 2005 sample_mpeg4.mp4.zip
-rw-r--r-- 1 saml saml 245779 Nov 3 2005 sample_mpeg4.mp4
Example
You can extract the AAC audio frpm the mP4 file.
$ ffmpeg -i sample_mpeg4.mp4 -vn -acodec copy sample_mpeg4.aac
FFmpeg version 0.6.3-rpmfusion, Copyright (c) 2000-2010 the FFmpeg developers
built on May 5 2011 19:20:01 with gcc 4.5.1 20100924 (Red Hat 4.5.1-4)
...
...
Output #0, adts, to 'sample_mpeg4.aac':
Metadata:
encoder : Lavf52.64.2
Stream #0.0(eng): Audio: aac, 32000 Hz, stereo, 48 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
size= 31kB time=4.99 bitrate= 50.4kbits/s
video:0kB audio:30kB global headers:0kB muxing overhead 3.594943%
The resulting AAC file.
$ ls -l |grep sample
-rw-rw-r-- 1 saml saml 31468 Oct 4 22:09 sample_mpeg4.aac
-rw-r--r-- 1 saml saml 245779 Nov 3 2005 sample_mpeg4.mp4
-rw-rw-r-- 1 saml saml 235829 Nov 4 2005 sample_mpeg4.mp4.zip
You can also use ffmpeg
to confirm the file format:
$ ffmpeg -i sample_mpeg4.aac
...
...
Input #0, aac, from 'sample_mpeg4.aac':
Duration: 00:00:05.59, bitrate: 45 kb/s
Stream #0.0: Audio: aac, 32000 Hz, stereo, s16, 45 kb/s
At least one output file must be specified
GUI
You can use VLC and it's Convert/Stream feature to do this. After launching VLC.
Example
Select Convert/Save from File pulldown
Select video file, and convert stream
Start the conversion
ffplay
appears to only support a single input file, so you'll need to use code to loop over a list of input files (and possibly to shuffle them); wildly assuming coreutils
(for shuf
), perhaps something like:
find musicdir -type f -name "*.mp3" | shuf | while read f; do ffplay -autoexit -- "$f"; done
This will of course break horribly if there are spaces or newlines in the filenames.
(My current music player is fairly similar, find ~/music -type f -name "*.mp3" | mpg123 --shuffle -Z --list -
)
Best Answer
Meanwhile I found the following solution:
ffmpeg -i video.flv audio.wav
and open in audacity audio.wavI think it is helpful to set the axis to
Log frequency
and use the largest value for size so select relevant peaks.