Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request - Please consider using m4a suffix for downloaded "--extract-audio" aac files. #240

Closed
bat999 opened this issue Dec 2, 2011 · 8 comments

Comments

@bat999
Copy link

bat999 commented Dec 2, 2011

Hi
I've been using the "--extract-audio" feature.
It seems to do a good job. It extracts the audio without transcoding. That's fine.

When I run command:-
youtube-dl -F http://www.youtube.com/watch?v=RdopMqrftXs
It tells me:-

Available formats:
34 : flv [360x640]
18 : mp4 [360x640]
43 : webm [360x640]
5 : flv [240x400]

When I use command:-
youtube-dl -t -f 5 --extract-audio http://www.youtube.com/watch?v=RdopMqrftXs
It downloads file:- The_Beatles_-_Let_It_Be-RdopMqrftXs.mp3

When I use command:-
youtube-dl -t -f 43 --extract-audio http://www.youtube.com/watch?v=RdopMqrftXs
It downloads file:- The_Beatles_-_Let_It_Be-RdopMqrftXs.ogg

These are both OK.

But when I use command:-
youtube-dl -t -f 18 --extract-audio http://www.youtube.com/watch?v=RdopMqrftXs
It downloads file:- The_Beatles_-_Let_It_Be-RdopMqrftXs.aac

Would it not be better if the downloaded aac file was muxed in mp4 container - so that the file suffix is m4a, not aac?
I think that FFmpeg can do this job.

If you agree that m4a is more suitable than aac, it might need to be applied to the "audio-format FORMAT" option also.
--audio-format FORMAT "best", "aac", "vorbis" or "mp3"; best by default

Thanks.

@bat999
Copy link
Author

bat999 commented Dec 2, 2011

EDIT
I've just tried muxing the TheBeatles aac into m4a with FFmpeg.
It needs "-absf aac_adtstoasc".
Like this:-
ffmpeg -i filename.aac -vn -acodec copy -absf aac_adtstoasc filename.m4a

@bat999 bat999 closed this as completed Dec 2, 2011
@bat999 bat999 reopened this Dec 2, 2011
@tsoliman
Copy link

tsoliman commented Dec 2, 2011

--extract-audio extracts the aac audio from the mp4 A/V file.
If you want it to remove video it should be called --remove-video ;)

@phihag phihag closed this as completed in 3e0ea7d Dec 8, 2011
@phihag
Copy link
Contributor

phihag commented Dec 8, 2011

You can now specify --audio-format m4a to get the desired behavior. I'm not sure why mp4 is preferable.

Unless there is a significant advantage of the mp4 container, I'm reluctant to adopt it as the default though.

@bat999
Copy link
Author

bat999 commented Dec 8, 2011

Yes, this is OK.

youtube-dl -t -f 5 --extract-audio http://www.youtube.com/watch?v=RdopMqrftXs
produces mp3.

youtube-dl -t -f 43 --extract-audio http://www.youtube.com/watch?v=RdopMqrftXs
produces ogg.

youtube-dl -t -f 18 --extract-audio http://www.youtube.com/watch?v=RdopMqrftXs
produces aac.

And for aac wrapped in mp4 (MPEG-4 Part 14) container with m4a suffix, use the "audio-format" option.
youtube-dl -t -f 18 --extract-audio --audio-format m4a http://www.youtube.com/watch?v=RdopMqrftXs

All of them without transcoding.

m4a is suitable for iPods.

Thanks. :-)

@hickford
Copy link

Hi. (Commenting here rather than opening a new issue). Philipp, there's two advantages to saving mp4 audio in a .m4a container rather a raw .aac stream file.

  1. The container allows tagging. Most software (VLC for one) can't tag .aac files.
  2. The container records length information. If you play a variable bit rate .aac in your favourite audio player, you'll see the reported duration is either wrong, or fluctuates as the song plays.

Workaround youtube-dl --extract-audio --audio format m4a or afterwards http://superuser.com/questions/370625/ffmpeg-command-to-convert-mp3-to-aac

@rg3
Copy link
Collaborator

rg3 commented Jan 30, 2013

My two cents: I recall having chosen "aac" over "m4a" as the default format back in my days because my cellphone could play aac files but not m4a ones even if the codec is AAC after all.

@hickford
Copy link

Makes sense. Today's ipod is the converse - it will play .m4a but not .aac

@phihag phihag reopened this Feb 1, 2013
@phihag
Copy link
Contributor

phihag commented Feb 1, 2013

Ok, we'll switch to m4a in the next release and see if anyone objects.

@phihag phihag closed this as completed in 0e33684 Feb 1, 2013
joedborg referenced this issue in joedborg/youtube-dl Nov 17, 2020
[pull] master from ytdl-org:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants