Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ###########################################
- # ALL CREDIT GOES TO SHAPEDOCTOR ON RIZON #
- ###########################################
- ####################################################################################
- ### Configuration options
- # Channel name
- channel="slip_stream"
- # Livestream account information
- username="waltjesus"
- password="mi11axzAB"
- # Immediately go live?
- autoLive="true"
- # This automatically adds the recording to the top of the Video on Demand list
- autoVOD="false"
- # This automatically adds the recording to the top of the auto-pilot playlist
- autoPilot="false"
- # Automatically records this broadcast
- autoRecord="false"
- # Allows you to set the buffer time (in seconds) of the live streaming in the player
- bufferTime=1
- ####################################################################################
- # Setup params
- if [ "$1" ]
- then
- moviePath=$1
- else
- echo "Syntax: $0 videoFile [ffpreset]"
- exit
- fi
- if [ "$2" ]
- then
- ffpreset=$2
- else
- ffpreset="normal"
- fi
- # Get width & height while suppressing annoying stderr output
- width=$(ffprobe -show_streams "$moviePath" 2> /dev/null | grep width | tr -d 'width=')
- height=$(ffprobe -show_streams "$moviePath" 2> /dev/null | grep height | tr -d 'height=')
- # Calculate aspect ratio
- aspectWidth=$(echo "scale=3; $width / $height" | bc)
- aspectHeight=1
- # Do the stuff
- ffmpeg -i "$moviePath" -re -acodec libfaac -ac 1 -vcodec libx264 -r 25 -vpre $ffpreset -threads 0 -f flv "rtmp://publish.livestream.com/mogulus/$channel/username=$username/password=$password/isAutoLive=$autoLive/aspectWidth=$aspectWidth/aspectHeight=$aspectHeight/bufferTime=$bufferTime/autoRecord=$autoRecord/autoVOD=$autoVOD/autoPilot=$autoPilot app=mogulus/$channel/username=$username/password=$password/isAutoLive=$autoLive/aspectWidth=$aspectWidth/aspectHeight=$aspectHeight/bufferTime=$bufferTime/autoRecord=$autoRecord/autoVOD=$autoVOD/autoPilot=$autoPilot tcurl=rtmp://publish.livestream.com/mogulus/$channel/username=$username/password=$password/isAutoLive=$autoLive/aspectWidth=$aspectWidth/aspectHeight=$aspectHeight/bufferTime=$bufferTime/autoRecord=$autoRecord/autoVOD=$autoVOD/autoPilot=$autoPilot swfUrl=rtmp://publish.livestream.com/mogulus/$channel/username=$username/password=$password/isAutoLive=$autoLive/aspectWidth=$aspectWidth/aspectHeight=$aspectHeight/bufferTime=$bufferTime/autoRecord=$autoRecord/autoVOD=$autoVOD/autoPilot=$autoPilot flashver=FME/2.5\20(compatible;\20FMSc/0.9) live=true"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement