I am on ubuntu and want to convert a mp4 video to an mp3 audio file but can't figure out how. I tried installing ffmpeg but it failed to encode the mp3. I've read the gstreamer does it but I can't figure out how. I have gstreamer and python installed. I can program with python, but am not super comfortable compiling software from source or any higher level command line stuff. I only know the basics on the command line.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- Can we recover audio from MFCC coefficients?
- How to get the background from multiple images by
- Evil ctypes hack in python
it will copy the raw audio stream, that should then be easily converted using sox, lame, vlc or whatnot. VLC has nice conversion options as well - and it sports a GUI. I don't know about extracting just the audio, but it should sure be capable of it
Easiest way to do this using GStreamer is to create GStreamer pipeline with decodebin element using
gst-launch
command-line utility:In case your mp4 file contains audio track in mp3 format you may want to avoid re-encoding:
If you want to use FFMPEG, you can use following command:
You can avoid re-encoding (in case audio track is in mp3) with
-acodec copy
option:Use TAE https://github.com/tuna74/TunaAudioExtracter. It does everything you want.
hmm, for an easy python solution, you could always checkout the python video converter, on https://pypi.python.org/pypi/video-converter a sample code is as follows:
where clip5.mp3 is the name of the output file,