Last active
March 22, 2020 10:49
-
-
Save eirenik0/34dc3f48fc13b148a23a7bc6eeea8a69 to your computer and use it in GitHub Desktop.
Get youtube video and restrem to the local rtmp
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
#!/bin/bash | |
on_die () | |
{ | |
# kill all children | |
pkill -KILL -P $$ | |
} | |
trap 'on_die' TERM | |
youtube-dl -f best "$1" -o - | ffmpeg -re -i pipe:0 -c:v copy -c:a aac -bsf:a aac_adtstoasc -ar 44100 -f flv "$1" & | |
#streamlink "$1" best -O | ffmpeg -re -i pipe:0 -c:v copy -c:a aac -bsf:a aac_adtstoasc -ar 44100 -f flv "$1" & | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment