FFMPEG와 yt-dlp 설치법 및 사용법

도스 창에서 yt치고 탭키를 누르면 yt-dlp.exe까지가 자동 입력이 됩니다;

  yt-dlp.exe

yt-dlp -f bestvideo+bestaudio URL 명령어를 사용하면 최상 옵션으로 알아서 동영상을 다운로드 해줌

※ yt-dlp 다운로드

https://github.com/yt-dlp/yt-dlp/releases/ 에서 다운로드

 

원하는 포맷으로 다운로드

  • 위의 방법을 사용하면 원하는 동영상 포맷(컨테이너, 해상도, 코덱 등)으로 다운로드가 안 될 수 있음
  • yt-dlp -F URL 명령어를 사용하면 다운로드 가능한 포맷 목록을 보여줌
  • 목록을 보고 원하는 비디오 및 오디오 포맷 ID를 메모한 후 yt-dlp -f VIDEO_ID+AUDIO_ID URL 명령어를 실행하면 원하는 포맷으로 동영상을 다운로드 해줌
# 다운로드 가능한 동영상 포맷 목록 출력
PS D:\Music> yt-dlp.exe -F https://www.youtube.com/watch?v=gsBecW-pKDM
[youtube] Extracting URL: https://www.youtube.com/watch?v=gsBecW-pKDM
[youtube] gsBecW-pKDM: Downloading webpage
[youtube] gsBecW-pKDM: Downloading ios player API JSON
[youtube] gsBecW-pKDM: Downloading android player API JSON
[youtube] gsBecW-pKDM: Downloading m3u8 information
[info] Available formats for gsBecW-pKDM:
ID  EXT   RESOLUTION FPS CH │   FILESIZE    TBR PROTO │ VCODEC           VBR ACODEC      ABR ASR MORE INFO
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb2 mhtml 48x27        0    │                   mhtml │ images                                   storyboard
sb1 mhtml 80x45        0    │                   mhtml │ images                                   storyboard
sb0 mhtml 160x90       0    │                   mhtml │ images                                   storyboard
233 mp4   audio only        │                   m3u8  │ audio only           unknown             Default
234 mp4   audio only        │                   m3u8  │ audio only           unknown             Default
599 m4a   audio only      2 │    1.13MiB    31k https │ audio only           mp4a.40.5   31k 22k ultralow, m4a_dash
600 webm  audio only      2 │    1.40MiB    38k https │ audio only           opus        38k 48k ultralow, webm_dash
139 m4a   audio only      2 │    1.79MiB    49k https │ audio only           mp4a.40.5   49k 22k low, m4a_dash
249 webm  audio only      2 │    2.02MiB    55k https │ audio only           opus        55k 48k low, webm_dash
250 webm  audio only      2 │    2.64MiB    72k https │ audio only           opus        72k 48k low, webm_dash
140 m4a   audio only      2 │    4.75MiB   130k https │ audio only           mp4a.40.2  130k 44k medium, m4a_dash
251 webm  audio only      2 │    5.06MiB   138k https │ audio only           opus       138k 48k medium, webm_dash
17  3gp   176x144     12  1 │    2.78MiB    76k https │ mp4v.20.3            mp4a.40.2       22k 144p
597 mp4   256x144     12    │    1.16MiB    32k https │ avc1.4d400b      32k video only          144p, mp4_dash
602 mp4   256x144     12    │ ~  3.55MiB    94k m3u8  │ vp09.00.10.08    94k video only
598 webm  256x144     12    │    1.14MiB    31k https │ vp9              31k video only          144p, webm_dash
269 mp4   256x144     24    │ ~  6.34MiB   169k m3u8  │ avc1.4D400C     169k video only
160 mp4   256x144     24    │    2.02MiB    55k https │ avc1.4D400C      55k video only          144p, mp4_dash
603 mp4   256x144     24    │ ~  6.02MiB   160k m3u8  │ vp09.00.11.08   160k video only
278 webm  256x144     24    │    2.79MiB    76k https │ vp09.00.11.08    76k video only          144p, webm_dash
229 mp4   426x240     24    │ ~ 11.63MiB   309k m3u8  │ avc1.4D4015     309k video only
133 mp4   426x240     24    │    4.39MiB   120k https │ avc1.4D4015     120k video only          240p, mp4_dash
604 mp4   426x240     24    │ ~ 11.26MiB   299k m3u8  │ vp09.00.20.08   299k video only
242 webm  426x240     24    │    5.02MiB   137k https │ vp09.00.20.08   137k video only          240p, webm_dash
230 mp4   640x360     24    │ ~ 30.14MiB   802k m3u8  │ avc1.4D401E     802k video only
134 mp4   640x360     24    │    9.18MiB   250k https │ avc1.4D401E     250k video only          360p, mp4_dash
18  mp4   640x360     24  2 │   19.92MiB   543k https │ avc1.42001E          mp4a.40.2       44k 360p
605 mp4   640x360     24    │ ~ 23.03MiB   613k m3u8  │ vp09.00.21.08   613k video only
243 webm  640x360     24    │    9.01MiB   246k https │ vp09.00.21.08   246k video only          360p, webm_dash
231 mp4   854x480     24    │ ~ 50.86MiB  1353k m3u8  │ avc1.4D401E    1353k video only
135 mp4   854x480     24    │   15.65MiB   427k https │ avc1.4D401E     427k video only          480p, mp4_dash
606 mp4   854x480     24    │ ~ 40.26MiB  1071k m3u8  │ vp09.00.30.08  1071k video only
244 webm  854x480     24    │   15.60MiB   426k https │ vp09.00.30.08   426k video only          480p, webm_dash
22  mp4   1280x720    24  2 │ ≈ 31.13MiB   828k https │ avc1.64001F          mp4a.40.2       44k 720p
232 mp4   1280x720    24    │ ~ 96.41MiB  2564k m3u8  │ avc1.4D401F    2564k video only
136 mp4   1280x720    24    │   25.63MiB   699k https │ avc1.4D401F     699k video only          720p, mp4_dash
609 mp4   1280x720    24    │ ~103.40MiB  2750k m3u8  │ vp09.00.31.08  2750k video only
247 webm  1280x720    24    │   31.17MiB   850k https │ vp09.00.31.08   850k video only          720p, webm_dash
270 mp4   1920x1080   24    │ ~176.23MiB  4687k m3u8  │ avc1.640028    4687k video only
137 mp4   1920x1080   24    │   69.71MiB  1901k https │ avc1.640028    1901k video only          1080p, mp4_dash
614 mp4   1920x1080   24    │ ~150.69MiB  4008k m3u8  │ vp09.00.40.08  4008k video only
248 webm  1920x1080   24    │   49.50MiB  1350k https │ vp09.00.40.08  1350k video only          1080p, webm_dash
620 mp4   2560x1440   24    │ ~369.26MiB  9821k m3u8  │ vp09.00.50.08  9821k video only
271 webm  2560x1440   24    │  144.61MiB  3944k https │ vp09.00.50.08  3944k video only          1440p, webm_dash
625 mp4   3840x2160   24    │ ~663.90MiB 17658k m3u8  │ vp09.00.50.08 17658k video only
313 webm  3840x2160   24    │  258.23MiB  7043k https │ vp09.00.50.08  7043k video only          2160p, webm_dash
PS D:\Music>

# 원하는 비디오 + 오디오 포맷으로 동영상 다운로드
# (위 리스트를 보면 mp4 3840p 비디오 ID는 625, webm 오디오 ID는 251)
> yt-dlp -f 251+625 https://www.youtube.com/watch?v=gsBecW-pKDM
[youtube] Extracting URL: https://www.youtube.com/watch?v=gsBecW-pKDM
[youtube] gsBecW-pKDM: Downloading webpage
[youtube] gsBecW-pKDM: Downloading ios player API JSON
[youtube] gsBecW-pKDM: Downloading android player API JSON
[youtube] gsBecW-pKDM: Downloading m3u8 information
[info] gsBecW-pKDM: Downloading 1 format(s): 251+625
[download] Destination: One moment in time (Live) (삶의 한 순간) - Dana Winner (다나 위너) Comforting⧸Healing Pop Song [번역⧸자막] [gsBecW-pKDM].f251.webm
[download] 100% of    5.06MiB in 00:00:00 at 10.65MiB/s
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 58
[download] Destination: One moment in time (Live) (삶의 한 순간) - Dana Winner (다나 위너) Comforting⧸Healing Pop Song [번역⧸자막] [gsBecW-pKDM].f625.mp4
[download] 100% of  258.26MiB in 00:00:29 at 8.77MiB/s
[Merger] Merging formats into "One moment in time (Live) (삶의 한 순간) - Dana Winner (다나 위너) Comforting⧸Healing Pop Song [번역⧸자막] [gsBecW-pKDM].webm"
Deleting original file One moment in time (Live) (삶의 한 순간) - Dana Winner (다나 위너) Comforting⧸Healing Pop Song [ 번역⧸자막] [gsBecW-pKDM].f625.mp4 (pass -k to keep)
Deleting original file One moment in time (Live) (삶의 한 순간) - Dana Winner (다나 위너) Comforting⧸Healing Pop Song [ 번역⧸자막] [gsBecW-pKDM].f251.webm (pass -k to keep)
PS D:\Music>