Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. #!/bin/sh
  2. sleep 8
  3. movie_path=$1
  4. vpre_preset=$2
  5. crf=$3
  6. audio_bandwidth=$4
  7. buffer_time=$5
  8. start_time=$6
  9. if [ "$crf" = "" ]; then
  10. crf="30"
  11. fi
  12. if [ "$vpre_preset" = "" ]; then
  13. vpre_preset="faster"
  14. fi
  15. if [ "$audio_bandwidth" = "" ]; then
  16. audio_bandwidth="128k"
  17. fi
  18. if [ "$buffer_time" = "" ]; then
  19. buffer_time="0"
  20. fi
  21. width=$(ffprobe -show_streams "$movie_path" 2>/dev/null | grep width | tr -d 'width=')
  22. height=$(ffprobe -show_streams "$movie_path" 2>/dev/null | grep height | tr -d 'height=')
  23. aspect_height="1"
  24. aspect_width=$( echo "scale=4; $width / $height" | bc )
  25. 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