Advertisement
metalx1000

Create an Android Boot Animation from a Youtube video

Oct 15th, 2022 (edited)
1,266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.50 KB | Source Code | 0 0
  1. #!/bin/bash
  2. ######################################################################
  3. #Copyright (C) 2022  Kris Occhipinti
  4. #https://filmsbykris.com
  5.  
  6. #This program is free software: you can redistribute it and/or modify
  7. #it under the terms of the GNU General Public License as published by
  8. #the Free Software Foundation, either version 3 of the License, or
  9. #(at your option) any later version.
  10.  
  11. #This program is distributed in the hope that it will be useful,
  12. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. #GNU General Public License for more details.
  15.  
  16. #You should have received a copy of the GNU General Public License
  17. #along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  
  19. #Based on code by Fire7ly
  20. #https://gist.github.com/Fire7ly/8a46d6605dac976e140911cf8a45a090
  21. ######################################################################
  22.  
  23. url="https://www.youtube.com/watch?v=Nl6l63AYg7s"
  24. tmp="/tmp/bootani"
  25. mp4="$tmp/video.mp4"
  26. rez="720"
  27. fps=30
  28.  
  29. [[ -d "$tmp" ]] && rm -fr "$tmp"
  30. mkdir -p "$tmp/part0"
  31.  
  32. youtube-dl -f 22 -o "$mp4" "$url"
  33. ffmpeg -i "$mp4" "$tmp/part0/00%05d.jpg"
  34.  
  35. for i in $tmp/part0/*.jpg
  36. do
  37.   convert $i -rotate 90 -resize $rez $i
  38. done
  39.  
  40. size="$(identify -format '%w %h' $tmp/part0/0000001.jpg)"
  41. echo "$size $fps" > "$tmp/desc.txt"
  42. echo "p 1 0 part0" >> "$tmp/desc.txt"
  43.  
  44. cd "$tmp"
  45. rm "$mp4"
  46. zip -0r bootanimation part0 desc.txt
  47.  
  48. echo "Animation file at $tmp/bootanimation.zip"
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement