Created
March 23, 2020 00:39
-
-
Save Tangent128/a6797e34416159cc6fb271be28d3cc7a to your computer and use it in GitHub Desktop.
webmetro streaming scripts
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/sh | |
FPS=30 | |
INRES=1680x1050 | |
test "$OUTRES" || OUTRES=672x420 | |
# if this needs to be fixed, you can use `ffmpeg -sources pulse` to list candidates | |
AUDIO_DEVICE=alsa_output.pci-0000_0b_00.3.analog-stereo.monitor | |
AUDIO_IN="-thread_queue_size 1024 -f pulse -channels 2 -i $AUDIO_DEVICE" | |
VIDEO_IN="-thread_queue_size 128 -f x11grab -r $FPS -s $INRES -i :0.0+0,0" | |
exec ffmetro.sh $AUDIO_IN $VIDEO_IN |
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/sh | |
test "$LOGLEVEL" || LOGLEVEL=info | |
test "$OUTRES" || OUTRES=-1:420 | |
test "$URL" || URL="http://wireguard.vpn.host.and.port.here.example.com/live/main" | |
test "$GOP" || GOP=72 | |
test "$SUBS" && SUBS=",subtitles=$SUBS" || SUBS="" | |
CODECS="-acodec libopus -vcodec vp8 -threads 4 -deadline good -cpu-used 15 -g $GOP -vb 800k -bufsize 1500k" | |
FILTER="-vf scale=$OUTRES${SUBS} -ac 2" | |
BIG_CLUSTERS="-live 1 -cluster_size_limit 10M -cluster_time_limit 10K" | |
OUTPUT="-f webm $BIG_CLUSTERS -" | |
OPTS="-loglevel $LOGLEVEL" | |
ffmpeg $OPTS "$@" $FILTER $CODECS $OUTPUT | webmetro send --throttle "$URL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment