#! /bin/bash # # FFMPEG transcoder for Youtube # For encoding settings see: https://support.google.com/youtube/answer/2853702? VBR="700k" # Bitrate of the video FPS="30" # Frames per second of the video YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube SOURCE="12121.mp4" # Source UDP KEY="-------" # The key you recieved from Youtube ffmpeg \ -i "$SOURCE" \ -c:v libx264 -pix_fmt yuv420p -vf "scale=-2:360" -r $FPS -g $(($FPS * 2)) -b:v $VBR \ -c:a aac -ar 44100 -b:a 128k \ -f flv "$YOUTUBE_URL/$KEY"