2024-11-20 17:01:07 +01:00
#! /bin/bash
2024-11-21 11:33:55 +01:00
## Do what the fuck you want license
2024-11-20 17:01:07 +01:00
## This script assumes ffmpeg is installed.
2024-11-21 11:32:29 +01:00
## You can find the m3u8 easily on peertube in the page-inspector of your broweser. For webshit, find it with `yt-dlp https://link.to/webshit --print-json | grep m3u8`
2024-11-20 17:01:07 +01:00
read -p 'Type desired preset (recommended ' faster'): ' PRESET
read -p 'Enter source URL for m3u8: ' SOURCE
read -p 'Enter the desitnation URL: ' DESTINATION
read -sp 'Enter the streaming key: ' KEY
# PRESET="faster" # ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo
# SOURCE="" # use yt-dlp to find the m3u8 stream
# DESTINATION=""
# KEY="" # Your peertubetube key.
ffmpeg \
-re -i " $SOURCE " -vcodec libx264 -preset $PRESET -maxrate 3000k -b:v 2500k \
-bufsize 600k -pix_fmt yuv420p -g 60 -c:a aac -b:a 160k -ac 2 \
-ar 48000 -f flv -s 1280x720 " $DESTINATION / $KEY "