Skip to content

Instantly share code, notes, and snippets.

@eirenik0
Last active March 22, 2020 10:49
Show Gist options
  • Save eirenik0/34dc3f48fc13b148a23a7bc6eeea8a69 to your computer and use it in GitHub Desktop.
Save eirenik0/34dc3f48fc13b148a23a7bc6eeea8a69 to your computer and use it in GitHub Desktop.
Get youtube video and restrem to the local rtmp
#!/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