Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- sleep 8
- movie_path=$1
- vpre_preset=$2
- crf=$3
- audio_bandwidth=$4
- buffer_time=$5
- start_time=$6
- if [ "$crf" = "" ]; then
- crf="30"
- fi
- if [ "$vpre_preset" = "" ]; then
- vpre_preset="faster"
- fi
- if [ "$audio_bandwidth" = "" ]; then
- audio_bandwidth="128k"
- fi
- if [ "$buffer_time" = "" ]; then
- buffer_time="0"
- fi
- width=$(ffprobe -show_streams "$movie_path" 2>/dev/null | grep width | tr -d 'width=')
- height=$(ffprobe -show_streams "$movie_path" 2>/dev/null | grep height | tr -d 'height=')
- aspect_height="1"
- aspect_width=$( echo "scale=4; $width / $height" | bc )
- ffmpeg -i "$movie_path" -re -acodec libmp3lame -ar 44100 -ab "$audio_bandwidth" -vcodec libx264 -vpre "$vpre_preset" -r 24 -crf $crf -async 1 -f flv "rtmp://fme.mogulus.com/mogulus/$channel/username=$username/password=$password/isAutoLive=true/autoVOD=false/autoRecord=false/aspectWidth=$aspect_width/aspectHeight=$aspect_height/bufferTime=$buffer_time app=mogulus/$channel/username=$username/password=$password/isAutoLive=true/autoRecord=false/aspectWidth=$aspect_width/aspectHeight=$aspect_height/bufferTime=$buffer_time tcurl=rtmp://fme.mogulus.com/mogulus/$channel/username=$username/password=$password/isAutolive=true/autoRecord=false/aspectWidth=$aspect_width/aspectHeight=$aspect_height/bufferTime=$buffer_time swfUrl=rtmp://publish.livestream.om/mogulus/$channel/username=$username/password=$password/isAutolive=true/autoRecord=false/aspectWidth=$aspect_width/aspectHeight=$aspect_height/bufferTime=$buffer_time flashver=FME/2.5\20(compatible;\20FMSc/0.9) live=true"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement