-
-
Save Paderman/c9accd1e74872ba59ad8ecafbbb09356 to your computer and use it in GitHub Desktop.
Stream video to youtube via ffmpeg
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 | |
# | |
# YouTube-Streaming mit FFmpeg | |
# | |
# YouTube wird mit 720p-Auflösung konfiguriert. Das Video ist nicht skaliert | |
# Quelldatei # | |
SOURCE="<File_Location.ext>" # UDP-Quelle (siehe SAP-Ankündigungen) | |
# ffmpeg-Einstellungen # | |
VBR="2500k" # Bitrate des Ausgabevideos (2500k = 2,5 MBit/s) | |
FPS="30" # FPS des ausgegebenen Video (30 Bilder pro Sekunde) | |
QUAL="medium" # FFmpeg-Qualitätsvoreinstellung (Standard: medium) | |
# YouTube-Einstellungen # | |
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # RTMP-basierte YouTube-URL (Backup-URL: rtmp://b.rtmp.youtube.com/live2?backup=1) | |
KEY="<Your_Stream_Key>" # YouTube-Streamschlüssel | |
ffmpeg -stream_loop -1 -i "$SOURCE" -deinterlace -vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k -f flv "$YOUTUBE_URL/$KEY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: this script is the German version from original script and is a little bit modified.
Hinweis: dieses Script ist die deutsche Version des Original-Scripts und wurde ein wenig angepasst.