Outils pour utilisateurs

Outils du site



Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

bash:youtube-dash [2014-09-20 00:17]
mitsu créée
bash:youtube-dash [2014-09-20 00:25]
Ligne 1: Ligne 1:
-====== Youtube HD 1080 (DASH) ====== 
-required: `youtube-dl` and `ffmpeg` 
-This script creates a folder in /tmp/ (which I have mounted as ramdisk), downloads the separate video and audio streams (see [[https://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP|about DASH]]), copies them into a Matroska container, sets the modtime and moves the resulting file in the current directory. 
-<file bash youtube-dash.run> 
-hashfold=$(echo "$1" | md5sum) 
-mkdir -p "/tmp/youtube-dash/$hashfold" 
-cd "/tmp/youtube-dash/$hashfold" 
-# downloading the video stream (MP4 1080p, else fallback 720p) 
-youtube-dl -f 137/136 -o "/tmp/youtube-dash/$hashfold/%(title)s.zvideo" "$1" 
-# downloading the audio stream (MP4A-AAC) 
-youtube-dl -f 140 -o "/tmp/youtube-dash/$hashfold/%(title)s.zaudio" "$1" 
-for file in *.zvideo; do 
- filemtime=$(stat -c %Y "$file") 
- ffmpeg -i "$file" -i "${file%.??????}.zaudio" -c:v copy -c:a copy "${file%.??????}.mkv" 
- touch -d "@$filemtime" "${file%.??????}.mkv" 
- mv "${file%.??????}.mkv" "$outdir/" 
- rm -r "/tmp/youtube-dash/$hashfold" 
bash/youtube-dash.txt · Dernière modification: 2014-09-20 00:25 (modification externe)