Youtube-dl: Difference between revisions
From Leo's Notes
This page was last edited on 24 February 2017, at 04:25.
| Line 27: | Line 27: | ||
=== Merging Audio / Video === | === Merging Audio / Video === | ||
This is the command {{code|youtube-dl}} invokes in order to merge audio and video. | This is the command {{code|youtube-dl}} invokes in order to merge audio and video. | ||
{{highlight|lang=terminal|code= | |||
$ ffmpeg command line: ffmpeg -y -i 'file:V.webm' -i 'file:A.m4a' -c copy -map 0:v:0 -map 1:a:0 'file:AV.mkv' | |||
}} | |||
[[Category:Linux]] | [[Category:Linux]] | ||
Revision as of 04:25, 24 February 2017
Basic Usage
To download a video with youtube-dl, just pass the YouTube URL as an argument. This will download the video in the highest quality.
$ youtube-dl "http://youtube.com/watch?v=xxx"
Listing All Available Formats
$ youtube-dl -F "http://youtube.com/watch?v=xxx"
Download a Specific Format
Say you want to download just the DASH audio from a video:
$ youtube-dl -f 141 "http://youtube.com/watch?v=xxx"
Downloading Audio
When downloading DASH audio using youtube-dl, you must convert the audio in order to play it using an audio player using ffmpeg.
ffmpeg -i input.m4a -vn -acodec copy output.m4a
This is needed since the MP4 container from youtube is set to dash rather than m4a and isn't recognized by most players.
Other
Merging Audio / Video
This is the command youtube-dl invokes in order to merge audio and video.
$ ffmpeg command line: ffmpeg -y -i 'file:V.webm' -i 'file:A.m4a' -c copy -map 0:v:0 -map 1:a:0 'file:AV.mkv'