Easily partially download
mp4 with python and youtube-dl!
$python3 --version
Python 3.7.3
$brew install ffmpeg
$mkdir mp4-download
$cd mp4-download
$python3 -m venv venv
$source venv/bin/activate
$pip install youtube-dl
partial download
$ ffmpeg $(youtube-dl -g 'https://www.youtube.com/watch?v=Nyg2qysqgpg' | sed "s/.*/-ss 03:55:00 -i &/") -t 00:01:00 -c copy out.mkv
$ for f in *.mkv;do ffmpeg -i "$f" -c:v copy -c:a aac -b:a 256k -strict -2 "${f%mkv}mp4";done
$ open out.mp4
It was good
Recommended Posts