Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hugh1988

macrumors newbie
Apr 11, 2008
6
0
The previous reply is exactly what you need. It works perfectly. Question answered!! Yey!!!
 

dupreeblue

macrumors newbie
Apr 2, 2009
2
0
FWIW - After having the same problem & googling I found this thread. Reading through & looking at what everyone said, I figured I'd just try something really simple. I duped the file in finder, then changed the extension from .mp4 to .m4a in Finder. Had the exact desired effect - went from movie to audio file, file size didn't change, audio quality didn't decrease.

Thanks for all the help earlier in this thread that helped me figure this out!
 

lisadelille

macrumors newbie
Aug 3, 2009
1
0
you people are brilliant geniuses!

I am the most tech-challenged, patience-lacking girl in the world.

Thanks to you, I was somehow able to figure out how to put a yoga video onto an ipod, audio only, so that I don't lose my mind while on a family vacation. It was the ffffmmmpgxxx that finally did the trick -- and free!

But had I not found this forum, with its painstaking clarification of communication regarding a very particular issue, I would never have believed it was possible for me to figure it out, let alone had the patience and hope needed to keep trying.

Usually when I am frustrated and out of my depth, I just get mad and quit, so I have learned something important today, thanks you to you all.

So, my enormous gratitude. You're a bunch of smart people, and I thank you.

-- Lisa Bolton
 

hugh1988

macrumors newbie
Apr 11, 2008
6
0
changed the extension from .mp4 to .m4a in Finder. Had the exact desired effect - went from movie to audio file, file size didn't change, audio quality didn't decrease.

Yes this would work, but as the file size does not change it means that the video track is still in the file using up space.

In Quicktime Pro, pressing Command+J lets you easily delete the video track from the .mp4 file. This saves as a .mov then you can change the extension to .m4a.

Question answered!
 
T

tunnelaudio

Guest
Yes this would work, but as the file size does not change it means that the video track is still in the file using up space.

In Quicktime Pro, pressing Command+J lets you easily delete the video track from the .mp4 file. This saves as a .mov then you can change the extension to .m4a.

Question answered!

Are you sure it deletes the video file because as I see it the audio file size is much larger than an m4a would usually be?
 

Pagga

macrumors 6502
Yes this would work, but as the file size does not change it means that the video track is still in the file using up space.

In Quicktime Pro, pressing Command+J lets you easily delete the video track from the .mp4 file. This saves as a .mov then you can change the extension to .m4a.

Question answered!

With Q10 (Snow Leopard) this command does not work!
Such a frustrating issue! I can´t believe there´s no easy way of solving this.


AARRRRRRGH!
 

qrismac

macrumors newbie
Dec 4, 2009
1
0
using quicktime pro 7 deleting the video track and saving the remaining audio as .mov and renaming it to .mp4 will result in a crippled soundfile that will be hard to tag (e.g. in itunes)

fission seems to be the only sw in this thread that seems to do the job properly ...

qm
 

frogdesign

Cancelled
Jan 5, 2010
6
0
ffmpeg copy

I did some googling and found this:

> ffmpeg -i Ultimate_Car_Sounds__Part_II.mp4 -vn -acodec copy ucs.m4a

it looks like there is no codec, so it should extract the audio portion to an mp4-audio-only file (.m4a)

Compare this command with this one:

> ffmpeg -i Videofile.mp4 -vn -acodec mp3 audiofile.mp3.

Hope this helps.
 

buthidae

macrumors member
Oct 21, 2008
31
7
After reading this thread I decided to just take the .mp4 file I had (complete with video) and just rename it to .m4a. Double-clicking dropped it straight in to iTunes as what seems to be a perfect audio file :)
 

merinith

macrumors newbie
Mar 20, 2010
1
0
Command line utilities

Seems like this is a common problem for a lot of people so I thought i would resurrect the thread with this response:

The command line utilities FAAD and LAME can be used to achieve what everyone is looking for very simply. FAAD can be used to decode the mp4/aac (to wav or raw PCM values) and LAME can be used to encode it into an mp3. These utilities are available for Mac, Linux and Windows.

The following is an example command for converting one into the other

Code:
faad -w -f 2 inputfile.mp4 | lame -r -h -b 192 - outputfile.mp3
 

breathesrain

macrumors regular
Feb 10, 2010
149
0
I would imagine that renaming the file to m4a and then converting the file with itunes, say, would get rid of the video portion.
 

antiaverage

macrumors newbie
Apr 7, 2011
1
0
I did some googling and found this:

> ffmpeg -i Ultimate_Car_Sounds__Part_II.mp4 -vn -acodec copy ucs.m4a

it looks like there is no codec, so it should extract the audio portion to an mp4-audio-only file (.m4a)

Compare this command with this one:

> ffmpeg -i Videofile.mp4 -vn -acodec mp3 audiofile.mp3.

Hope this helps.

This is the best answer.

ffmpeg lets you extract the audio with no transcoding.

####

the command:
Code:
ffmpeg -i source.mp4 -vn -acodec copy destination.m4a

  • calls up ffmpeg
  • -i asks for the input file
  • the input file in this case is source.mp4, change to your mp4
  • -vn disables video recording, effectively ignoring the video
  • -acodec asks for the audio codec
  • in this case, the special value copy is given to specify that the raw codec data must be copied as is, so you know no transcoding is happening
  • and finally we specify an output file, in this case destination.m4a, but you could name it whatever you'd like

####

I ran the ffmpeg command on a 14.3 MB mp4 movie file and ended up with a 4 MB m4a audio file with no change in quality.

If you're wondering how to run ffmpeg on your Mac, you'll want to take a look at the MacPorts project.

####

This is advanced stuff. So if you're looking for an easier method, ffmpegx is a GUI frontend for ffmpeg that may serve your purposes. However, I haven't tried that method yet.

####

This is all open source stuff, so yes, it's all free.

####

MAX - easy, powerful and free.

http://sbooth.org/Max/

Freeware, most platforms.... use the convert/save function, give it a destination, select the codec and container and bob is your uncle!
http://www.videolan.org/vlc/

Both of these methods cause transcoding.
 
Last edited:

Canubis

macrumors 6502
Oct 22, 2008
425
524
Vienna, Austria
Thank you for that very detailed description @antiaverage!

I've just tried that "trick" with ffmpeg and got an .m4a file that plays well in Finder, QuickTime Player etc but it won't play in iTunes. There it also says that it would have length of 789:57:13.
Interestingly, the exactly same happened, when I extracted audio from a completely different video with the same method. Also for that one, the time lenght was 789:57:13.

So I tried extracting only the audio track with the same command and specified an output file with .mp4 as file extension. Now the track length was correctly displayed in iTunes and it could still be played back well. Even on an iPod nano (4th gen). It seems iTunes is expecting some additional information for files with a .m4a extension. Any idea what that could be?
 
Last edited:

Mr Brainz

macrumors newbie
Oct 19, 2008
24
0
ffmpegx to get ffmpeg

Hi,

I can see this thread is very old, but it still comes up high on Google searches relating to audio extraction from MP4s.

Just wanted to share my results.

I used a combination of things mentioned on here.

First of all - compiling ffmpeg from source is a long and unnecessary step (when someone else has done it for you).

This is what I did:

1: Downloaded ffmpegx and installed it.
2: Right-clicked on the .app file in the applications folder and chose "Show Package Contents"
3: Copied the folder /Contents/Resources/ to my desktop.
4: Copied my MP4 video into the Resources folder on the desktop.
5: Opened Terminal and went into the folder cd Desktop/Resources
6: Ran the command listed here to do the extraction ./ffmpeg -i vid.mp4 -vn -acodec copy audio.m4a

And that's it. Lossless audio ripping, no compilation of ffmpeg from scratch.
 

KeithPratt

macrumors 6502a
Mar 6, 2007
804
3
  • Download MPEG Streamclip
  • Open video
  • File > Save Track > Save Audio Track
  • In Finder, change extension from MP4 to M4A
  • Bada boom bada bing
 

Mockman

macrumors newbie
Feb 28, 2011
2
0
Finally!

Thank you. This works and is simple to understand. This problem has bedevilled me for a long time.

Note that I quote them both because I didn't see the light when reading Frogdesign's post. It wasn't until I read Antiaverage's that it registered for me. And as an added bonus, it seems to answer the OP's request.

So thanks again to both of you.

I did some googling and found this:

> ffmpeg -i Ultimate_Car_Sounds__Part_II.mp4 -vn -acodec copy ucs.m4a

it looks like there is no codec, so it should extract the audio portion to an mp4-audio-only file (.m4a)

Compare this command with this one:

> ffmpeg -i Videofile.mp4 -vn -acodec mp3 audiofile.mp3.

Hope this helps.



This is the best answer.

ffmpeg lets you extract the audio with no transcoding.

####

the command:
Code:
ffmpeg -i source.mp4 -vn -acodec copy destination.m4a

  • calls up ffmpeg
  • -i asks for the input file
  • the input file in this case is source.mp4, change to your mp4
  • -vn disables video recording, effectively ignoring the video
  • -acodec asks for the audio codec
  • in this case, the special value copy is given to specify that the raw codec data must be copied as is, so you know no transcoding is happening
  • and finally we specify an output file, in this case destination.m4a, but you could name it whatever you'd like

####
 

Braaam

macrumors newbie
Apr 16, 2010
15
0
MPEG streamclip

mpeg streamclip (free app) does the same thing as ffmpeg with a graphical interface (no re-encode). Thanks to KeithPratt for mentioning it.

Note: you have to get the beta version, regular doesn't have the 'save to track' feature.

get it here: http://www.squared5.com/svideo/mpeg-streamclip-mac.html

  • Download MPEG Streamclip
  • Open video
  • File > Save Track > Save Audio Track
  • In Finder, change extension from MP4 to M4A
  • Bada boom bada bing
 

cgbier

macrumors 6502a
Jun 6, 2011
933
2
mpeg streamclip (free app) does the same thing as ffmpeg with a graphical interface (no re-encode). Thanks to KeithPratt for mentioning it.

Note: you have to get the beta version, regular doesn't have the 'save to track' feature.

get it here: http://www.squared5.com/svideo/mpeg-streamclip-mac.html
One of the basics of Streamclip is ffmpeg. Otherwise, it wouldn't be free. MPEG Streamclip does rely on Perian, and doesn't do much more than offering a GUI to Perian.
 

KeithPratt

macrumors 6502a
Mar 6, 2007
804
3
One of the basics of Streamclip is ffmpeg. Otherwise, it wouldn't be free. MPEG Streamclip does rely on Perian, and doesn't do much more than offering a GUI to Perian.

Where are you getting this information from?

MPEG Streamclip is more of an extended (and free) version of Quicktime Pro. Quicktime is its foundation. It can make use of Perian just as Quicktime does, but does not rely on it or ffmpeg.
 

efekt

macrumors newbie
Oct 29, 2011
1
0
Solution is simple: Audacity

It's a free audio editing tool. You simply drag the video onto the window you open and export it to mp3. Simplz.
 

tttulio

macrumors newbie
Sep 19, 2008
3
0
Gosh, I have the same question, Just trying to split the already encoded file.
Most posters here don't grab this notion.
If you don't know the answer, stop telling people to re-encode it.

Thanks.

Sorry, maybe I just don't get it or you don't actually understand what I intend to do.

If I understand you right, FCP.guru.guy, you tell me to convert the video to AIFF to just get the audio out and then convert it back to AAC for a smaller filesize. But this is definitely not lossless and its reencoding for two times. :confused:

What I am looking for is a direct way of splitting the audio from the video track and saving it to disk as is. In the same format. No reencoding.

I apologize honestly if I just didn't understand what you told me.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.