Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. # derp
  2. # ./autopad_spaces.sh /full/path/to/media
  3.  
  4. moviePath=$1
  5.  
  6. ln -s "$moviePath" you_are_retarded
  7.  
  8. x264Preset=$2
  9.  
  10. if [ "$x264Preset" = "" ]; then
  11. x264Preset="faster"
  12. fi
  13.  
  14. ffprobe -show_streams you_are_retarded > /tmp/probetmp.txt
  15.  
  16. width=$(cat /tmp/probetmp.txt | grep width | sed 's/width=//')
  17. height=$(cat /tmp/probetmp.txt | grep height | sed 's/height=//')
  18.  
  19. echo $width
  20. echo $height
  21.  
  22. scaleFactor=$(echo "scale=4; 0.75 * $width" | bc)
  23.  
  24. echo $scaleFactor
  25.  
  26. padTotal=$(echo "scale=4; $scaleFactor - $height" | bc)
  27.  
  28. echo $padTotal
  29.  
  30. padPixel=$(echo "scale=0; $padTotal / 2" | bc)
  31.  
  32. echo $padPixel
  33. echo $x264Preset
  34.  
  35. # aspects greater than .75 h/w will cause $padPixel to be negative
  36.  
  37. if [ "$padPixel" < "0" ]; then
  38. padPixel=$"0"
  39. fi
  40.  
  41. ffmpeg -i you_are_retarded -re -acodec libmp3lame -ac 2 -ar 44100 -vcodec libx264 -vpre $x264Preset -f flv -padtop $padPixel -padbottom $padPixel 'rtmp://fme.mogulus.com/mogulus/smausmau/username=flapdoodler/password=00e635a9/isAutoLive=true/autoVOD=yes/autoRecord=false app=mogulus/smausmau/username=flapdoodler/password=00e635a9/isAutoLive=true/autoRecord=false tcurl=rtmp://fme.mogulus.com/mogulus/smausmau/username=flapdoodler/password=00e635a9/isAutolive=true/autoRecord=false swfUrl=rtmp://publish.livestream.com/mogulus/smausmau/username=flapdoodler/password=00e635a9/isAutolive=true/autoRecord=false flashver=FME/2.5\20(compatible;\20FMSc/0.9) live=true'
  42.  
  43. rm -rf you_are_retarded
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement