Last active
July 22, 2018 07:05
-
-
Save onokatio/0c99c3ff5ba873744bc1593adb174217 to your computer and use it in GitHub Desktop.
Linuxで、コマンドだけでyoutubeから動画をダウンロードして任意の時間を切り出してgifアニ化する ref: https://qiita.com/onokatio/items/40b12a2c50b4f9cc3e75
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://www.youtube.com/watch?v=hogehoge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl | |
| $ sudo chmod a+rx /usr/local/bin/youtube-dl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ brew install youtube-dl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo pip install --upgrade youtube_dl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ youtube-dl -F https://www.youtube.com/watch?v=hogehoge | |
| [youtube] hoge: Downloading webpage | |
| [youtube] hoge: Downloading video info webpage | |
| [youtube] hoge: Extracting video information | |
| [youtube] hoge: Downloading MPD manifest | |
| [info] Available formats for hoge: | |
| format code extension resolution note | |
| 139 m4a audio only DASH audio 49k , m4a_dash container, mp4a.40.5@ 48k (22050Hz) | |
| 249 webm audio only DASH audio 61k , opus @ 50k, 3.00MiB | |
| 250 webm audio only DASH audio 78k , opus @ 70k, 3.81MiB | |
| 171 webm audio only DASH audio 124k , vorbis@128k, 5.91MiB | |
| 140 m4a audio only DASH audio 128k , m4a_dash container, mp4a.40.2@128k (44100Hz) | |
| 251 webm audio only DASH audio 150k , opus @160k, 7.11MiB | |
| 160 mp4 256x144 DASH video 72k , avc1.4d400c, 24fps, video only | |
| 278 webm 256x144 144p 110k , webm container, vp9, 24fps, video only, 4.38MiB | |
| 133 mp4 426x240 DASH video 136k , avc1.4d4015, 24fps, video only | |
| 242 webm 426x240 240p 216k , vp9, 24fps, video only, 6.56MiB | |
| 134 mp4 640x360 DASH video 314k , avc1.4d401e, 24fps, video only | |
| 243 webm 640x360 360p 404k , vp9, 24fps, video only, 11.71MiB | |
| 135 mp4 854x480 DASH video 565k , avc1.4d401e, 24fps, video only | |
| 244 webm 854x480 480p 690k , vp9, 24fps, video only, 18.09MiB | |
| 136 mp4 1280x720 DASH video 928k , avc1.4d401f, 24fps, video only | |
| 247 webm 1280x720 720p 1350k , vp9, 24fps, video only, 35.56MiB | |
| 17 3gp 176x144 small , mp4v.20.3, mp4a.40.2@ 24k | |
| 36 3gp 320x180 small , mp4v.20.3, mp4a.40.2 | |
| 43 webm 640x360 medium , vp8.0, vorbis@128k | |
| 18 mp4 640x360 medium , avc1.42001E, mp4a.40.2@ 96k | |
| 22 mp4 1280x720 hd720 , avc1.64001F, mp4a.40.2@192k (best) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ youtube-dl -f 18 https://www.youtube.com/watch?v=hogehoge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ffmpeg -ss 切り出し開始時間 -i 入力ファイル名 -t 切り出す秒数 出力ファイル名 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ffmpeg -ss 143.5 -i hoge.mp4 -t 1.3 hoge2.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ffmpeg -i hoge2.mp4 -an -r 15 -pix_fmt rgb24 -f git hige.gif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment