Advertisement
Guest User

Untitled

a guest
Aug 9th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. 1.
  2. #!/bin/sh
  3. 2.
  4.  
  5. 3.
  6. ###########################################
  7. 4.
  8. # ALL CREDIT GOES TO SHAPEDOCTOR ON RIZON #
  9. 5.
  10. ###########################################
  11. 6.
  12.  
  13. 7.
  14. ####################################################################################
  15. 8.
  16. ### Configuration options
  17. 9.
  18.  
  19. 10.
  20. # Channel name
  21. 11.
  22. channel="slip_stream"
  23. 12.
  24.  
  25. 13.
  26. # Livestream account information
  27. 14.
  28. username="waltjesus"
  29. 15.
  30. password="mi11axzAB"
  31. 16.
  32.  
  33. 17.
  34. # Immediately go live?
  35. 18.
  36. autoLive="true"
  37. 19.
  38.  
  39. 20.
  40. # This automatically adds the recording to the top of the Video on Demand list
  41. 21.
  42. autoVOD="false"
  43. 22.
  44.  
  45. 23.
  46. # This automatically adds the recording to the top of the auto-pilot playlist
  47. 24.
  48. autoPilot="false"
  49. 25.
  50.  
  51. 26.
  52. # Automatically records this broadcast
  53. 27.
  54. autoRecord="false"
  55. 28.
  56.  
  57. 29.
  58. # Allows you to set the buffer time (in seconds) of the live streaming in the player
  59. 30.
  60. bufferTime=1
  61. 31.
  62.  
  63. 32.
  64. ####################################################################################
  65. 33.
  66.  
  67. 34.
  68. # Setup params
  69. 35.
  70.  
  71. 36.
  72. if [ "$1" ]
  73. 37.
  74. then
  75. 38.
  76. moviePath=$1
  77. 39.
  78. else
  79. 40.
  80. echo "Syntax: $0 videoFile [ffpreset]"
  81. 41.
  82. exit
  83. 42.
  84. fi
  85. 43.
  86. if [ "$2" ]
  87. 44.
  88. then
  89. 45.
  90. ffpreset=$2
  91. 46.
  92. else
  93. 47.
  94. ffpreset="veryfast"
  95. 48.
  96. fi
  97. 49.
  98.  
  99. 50.
  100. # Get width & height while suppressing annoying stderr output
  101. 51.
  102. width=$(ffprobe -show_streams "$moviePath" 2> /dev/null | grep width | tr -d 'width=')
  103. 52.
  104. height=$(ffprobe -show_streams "$moviePath" 2> /dev/null | grep height | tr -d 'height=')
  105. 53.
  106.  
  107. 54.
  108. # Calculate aspect ratio
  109. 55.
  110. aspectWidth=$(echo "scale=3; $width / $height" | bc)
  111. 56.
  112. aspectHeight=1
  113. 57.
  114.  
  115. 58.
  116. # Do the stuff
  117. 59.
  118. 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