Alternatives for converting MP4 to MP3 and editing?

Brian Cluff brian at snaptek.com
Wed Mar 27 11:12:24 MST 2013


On 03/26/2013 05:23 PM, joe at actionline.com wrote:
> Alternatives for converting MP4 to MP3 and editing?
>
> #1. What is the best/easiest/most-efficient way to
>      convert an mp4 video file to an mp3 audio file?
>
> #2. Is anyone using 'avconv'? What would a suitable
>      syntax be to use that?

Using avconv to strip the audio of video, convert it to mp3 and put in a 
file is easy.  Just run:
avconv -i your_video.mp4 output_audio.mp3

avconv will then re-encode the file to mp3.  The problem is that you 
will get some loss of quality.  A better way to do it is to figure out 
what kind of audio the mp4 has in it to begin with using avprobe

avprobe your_video.mp4

you will get a bunch of output, but what you are looking for is the 
lines that begin with "Stream" an in particular Stream, then Audio, like 
this:

     Stream #0.0(und): Video: h264 (Main), yuv420p, 1280x720 [PAR 1:1 
DAR 16:9], 3111 kb/s, 29.48 fps, 90k tbr, 90k tbn, 180k tbc
     Metadata:
       creation_time   : 2012-12-10 23:34:12
     Stream #0.1(eng): Audio: aac, 48000 Hz, mono, s16, 159 kb/s
add -codec copy
Look at the Stream... Audio line and just after Audio: is the codec used 
to compress the audio in your file.  Mp4's usually have aac format audio.

To get a raw output of exactly what is encoded in the video file just 
add "-codec copy" to the options of your avconv command and change the 
output file name to the codec you got out of avprobe.

So for the video with the above stream I would run:

avconv -i your_video.mp4 -codec copy output_audio.aac

Not only will this give you an exact copy, but since it doesn't have to 
re-encode, it will finish, much much faster.

> #3. What Linux tool offers the easiest/most-efficient
>      way to edit (shorten) an audio file?

Just load the file into audacity, select what you don't want to be in 
the file and press the delete key.  When done, make sure you export your 
file so that you can get it into the end format that you want.  Just 
doing a save in audacity, saves the file in audacitie's own format.

> Is there some significant advantage to the .ogg format?

Ogg is a free format, and you will usually get a slightly better audio 
quality for a similar size as mp3.  The biggest problem is that of 
support.  If you will be floating your files around, not everyone will 
be able to play it.  That being said, pretty much everyone has an ogg 
player these days since just about every web browser supports ogg.

Brian Cluff


More information about the PLUG-discuss mailing list