Last active
January 22, 2024 05:17
-
-
Save tom-huntington/22c22fe89e703c48594f6e2724dfe459 to your computer and use it in GitHub Desktop.
Download a portion of a youtube live stream
This file contains 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
#!/bin/bash | |
#Arguments: URL, Starting Timestamp -5 seconds, Ending Timestamp, video file name | |
set -x; | |
readarray -t urls <<< "$(yt-dlp -f bestvideo[ext=mp4][vcodec^=avc1]+140 --youtube-skip-dash-manifest -g "$1")" | |
ffmpeg -ss $2 -to $3 -i "${urls[0]}" -ss $2 -to $3 -i "${urls[1]}" -ss 10 -map 0:v -map 1:a -c:v copy -c:a copy "${4}.mp4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment