Youtube-dl: Difference between revisions

From Leo's Notes
This page was last edited on 24 February 2017, at 04:23.
merging audio and video.
m Text replacement - "{{Highlight|lang=bash" to "{{highlight|lang=terminal"
Line 1: Line 1:
== Basic Usage ==
== Basic Usage ==
=== Listing All Available Formats ===
=== Listing All Available Formats ===
{{Highlight|lang=bash|code=
{{highlight|lang=terminal|code=
youtube-dl -F "http://youtube.com/watch?v=
youtube-dl -F "http://youtube.com/watch?v=
}}
}}
Line 7: Line 7:
=== Download a Specific Format ===
=== Download a Specific Format ===
Say you want to download just the DASH audio from a video:
Say you want to download just the DASH audio from a video:
{{Highlight|lang=bash|code=
{{highlight|lang=terminal|code=
youtube-dl -f 141 "http://youtube.com/watch?v=
youtube-dl -f 141 "http://youtube.com/watch?v=
}}
}}
Line 13: Line 13:
== Downloading Audio ==
== Downloading Audio ==
When downloading DASH audio using {{code|youtube-dl}}, you must convert the audio in order to play it using an audio player using {{code|ffmpeg}}.
When downloading DASH audio using {{code|youtube-dl}}, you must convert the audio in order to play it using an audio player using {{code|ffmpeg}}.
{{Highlight|lang=bash|code=
{{highlight|lang=terminal|code=
ffmpeg -i input.m4a -vn -acodec copy output.m4a
ffmpeg -i input.m4a -vn -acodec copy output.m4a
}}
}}

Revision as of 04:23, 24 February 2017

Basic Usage

Listing All Available Formats

youtube-dl -F "http://youtube.com/watch?v=

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=

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'