Skip to content

Instantly share code, notes, and snippets.

@duan-li
Last active February 18, 2023 00:26
Show Gist options
  • Save duan-li/4fc11969cb1e3d115d32ec28503180f8 to your computer and use it in GitHub Desktop.
Save duan-li/4fc11969cb1e3d115d32ec28503180f8 to your computer and use it in GitHub Desktop.
youtube-dl and ffmpeg download audio
#download
youtube-dl -F <URL> # see all format
youtube-dl -f <format> <URL> # download format
# DASH decode
ffmpeg -i input.m4a -vn -acodec copy output.m4a # Solve: writing DASH m4a. Only some players support this container. Install ffmpeg or avconv to fix this automatically.
#mp3
ffmpeg -codecs help | grep 'mp3' # check mp3 codecs
ffmpeg -i input.m4a -acodec libmp3lame -ab 128k output.mp3
#or
ffmpeg -i input.wav -vn -ar 44100 -ac 2 -ab 192k -f mp3 output.mp3
#ref:
#https://ubuntuforums.org/showthread.php?t=1614765
#http://superuser.com/questions/441361/strip-metadata-from-all-formats-with-ffmpeg
#http://superuser.com/questions/837067/convert-youtube-dash-audio-youtube-dl-to-m4a-aac-dl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment